Skip to content

Commit

Permalink
fixup! overlord/devicestate,secboot: fix factory reset on older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
valentindavid committed Jan 27, 2025
1 parent 7c2e31f commit 91da819
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion overlord/devicestate/handlers_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,6 @@ func deleteOldSaveKey(saveMntPnt string) error {
"factory-reset-old-fallback": true,
}


if err := secbootDeleteKeys(diskPath, toDelete); err != nil {
return fmt.Errorf("cannot delete previous keys: %w", err)
}

Check warning on line 1392 in overlord/devicestate/handlers_install.go

View check run for this annotation

Codecov / codecov/patch

overlord/devicestate/handlers_install.go#L1391-L1392

Added lines #L1391 - L1392 were not covered by tests
Expand Down
2 changes: 1 addition & 1 deletion secboot/secboot.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,5 +260,5 @@ type NonAtomicOperationAllowedFlag struct {
// they should be used with care and intentionally (that's why the
// extra hoops).
func AllowNonAtomicOperation() *NonAtomicOperationAllowedFlag {
return &NonAtomicOperationAllowedFlag{}
return &NonAtomicOperationAllowedFlag{}
}
16 changes: 8 additions & 8 deletions secboot/secboot_sb.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ func sbNewLUKS2KeyDataReaderImpl(device, slot string) (sb.KeyDataReader, error)
}

var (
sbActivateVolumeWithKey = sb.ActivateVolumeWithKey
sbActivateVolumeWithKeyData = sb.ActivateVolumeWithKeyData
sbActivateVolumeWithRecoveryKey = sb.ActivateVolumeWithRecoveryKey
sbDeactivateVolume = sb.DeactivateVolume
sbAddLUKS2ContainerUnlockKey = sb.AddLUKS2ContainerUnlockKey
sbRenameLUKS2ContainerKey = sb.RenameLUKS2ContainerKey
sbNewLUKS2KeyDataReader = sbNewLUKS2KeyDataReaderImpl
sbSetProtectorKeys = sb_plainkey.SetProtectorKeys
sbActivateVolumeWithKey = sb.ActivateVolumeWithKey
sbActivateVolumeWithKeyData = sb.ActivateVolumeWithKeyData
sbActivateVolumeWithRecoveryKey = sb.ActivateVolumeWithRecoveryKey
sbDeactivateVolume = sb.DeactivateVolume
sbAddLUKS2ContainerUnlockKey = sb.AddLUKS2ContainerUnlockKey
sbRenameLUKS2ContainerKey = sb.RenameLUKS2ContainerKey
sbNewLUKS2KeyDataReader = sbNewLUKS2KeyDataReaderImpl
sbSetProtectorKeys = sb_plainkey.SetProtectorKeys
)

func init() {
Expand Down

0 comments on commit 91da819

Please sign in to comment.