Skip to content

Commit

Permalink
MEDIUM: add abort on ssl certificate transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
hdurand0710 committed Nov 6, 2024
1 parent c4d7dd3 commit 75c1295
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions runtime/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ type Cert interface {
NewCertEntry(filename string) error
SetCertEntry(filename, payload string) error
CommitCertEntry(filename string) error
AbortCertEntry(filename string) error
AddCrtListEntry(crtList string, entry CrtListEntry) error
}

Expand Down
17 changes: 17 additions & 0 deletions runtime/runtime_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,23 @@ func (c *client) CommitCertEntry(filename string) error {
return nil
}

func (c *client) AbortCertEntry(filename string) error {
if len(c.runtimes) == 0 {
return fmt.Errorf("no valid runtimes found")
}
var lastErr error
for _, runtime := range c.runtimes {
err := runtime.AbortCertEntry(filename)
if err != nil {
lastErr = err
}
}
if lastErr != nil {
return lastErr
}
return nil
}

func (c *client) AddCrtListEntry(crtList string, entry CrtListEntry) error {
if len(c.runtimes) == 0 {
return fmt.Errorf("no valid runtimes found")
Expand Down

0 comments on commit 75c1295

Please sign in to comment.