Skip to content

Commit 75c1295

Browse files
committed
MEDIUM: add abort on ssl certificate transaction
1 parent c4d7dd3 commit 75c1295

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

runtime/interface.go

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ type Cert interface {
140140
NewCertEntry(filename string) error
141141
SetCertEntry(filename, payload string) error
142142
CommitCertEntry(filename string) error
143+
AbortCertEntry(filename string) error
143144
AddCrtListEntry(crtList string, entry CrtListEntry) error
144145
}
145146

runtime/runtime_client.go

+17
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,23 @@ func (c *client) CommitCertEntry(filename string) error {
12501250
return nil
12511251
}
12521252

1253+
func (c *client) AbortCertEntry(filename string) error {
1254+
if len(c.runtimes) == 0 {
1255+
return fmt.Errorf("no valid runtimes found")
1256+
}
1257+
var lastErr error
1258+
for _, runtime := range c.runtimes {
1259+
err := runtime.AbortCertEntry(filename)
1260+
if err != nil {
1261+
lastErr = err
1262+
}
1263+
}
1264+
if lastErr != nil {
1265+
return lastErr
1266+
}
1267+
return nil
1268+
}
1269+
12531270
func (c *client) AddCrtListEntry(crtList string, entry CrtListEntry) error {
12541271
if len(c.runtimes) == 0 {
12551272
return fmt.Errorf("no valid runtimes found")

0 commit comments

Comments
 (0)