Skip to content

Commit

Permalink
Add support for OEM dbx enrollment
Browse files Browse the repository at this point in the history
  • Loading branch information
Cornelicorn committed Aug 10, 2023
1 parent 99e260c commit dae25b8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cmd/sbctl/enroll-keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ func KeySync(guid util.EFIGUID, keydir string, oems []string) error {
}
sigdb.AppendDatabase(oemSigDb)

// dbx
oemSigDbx, err := certs.GetOEMCerts(oem, "dbx")
if err != nil {
return fmt.Errorf("could not enroll db keys: %w", err)
}
sigdbx.AppendDatabase(oemSigDbx)

// KEK
oemSigKEK, err := certs.GetOEMCerts(oem, "KEK")
if err != nil {
Expand All @@ -155,6 +162,13 @@ func KeySync(guid util.EFIGUID, keydir string, oems []string) error {
}
sigdb.AppendDatabase(customSigDb)

// dbx
customSigDbx, err := certs.GetCustomCerts(keydir, "dbx")
if err != nil {
return fmt.Errorf("could not enroll custom dbx keys: %w", err)
}
sigdbx.AppendDatabase(customSigDbx)

// KEK
customSigKEK, err := certs.GetCustomCerts(keydir, "KEK")
if err != nil {
Expand All @@ -172,6 +186,8 @@ func KeySync(guid util.EFIGUID, keydir string, oems []string) error {
switch cert {
case "db":
sigdb.AppendDatabase(builtinSigDb)
case "dbx":
sigdbx.AppendDatabase(builtinSigDb)
case "KEK":
sigkek.AppendDatabase(builtinSigDb)
case "PK":
Expand Down

0 comments on commit dae25b8

Please sign in to comment.