Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secboot: re-introduce v1 fde hook format #14638

Open
wants to merge 3 commits into
base: fde-manager-features
Choose a base branch
from

Conversation

valentindavid
Copy link
Contributor

No description provided.

@valentindavid valentindavid added Run nested The PR also runs tests inluded in nested suite FDE Manager Pull requests that target FDE manager branch labels Oct 17, 2024
bboozzoo
bboozzoo previously approved these changes Oct 17, 2024
Copy link
Contributor

@bboozzoo bboozzoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

secboot/secboot_hooks.go Outdated Show resolved Hide resolved
secboot/secboot_hooks.go Outdated Show resolved Hide resolved
@valentindavid valentindavid marked this pull request as ready for review October 18, 2024 13:17
@valentindavid
Copy link
Contributor Author

This was manually tested with

  • snapd 2.49.2
  • removing the assume in the pc gadget from latest/edge
  • rebuild pc-kernel latest/edge with core-initrd core20 branch and snap-bootstrap from this PR
  • core20 from latest/edge

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 56.12245% with 43 lines in your changes missing coverage. Please review.

Project coverage is 78.85%. Comparing base (24018ee) to head (d3a6b29).
Report is 4 commits behind head on fde-manager-features.

Files with missing lines Patch % Lines
secboot/secboot_tpm.go 64.28% 23 Missing and 2 partials ⚠️
secboot/secboot_hooks.go 25.00% 9 Missing ⚠️
secboot/secboot_sb.go 43.75% 8 Missing and 1 partial ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           fde-manager-features   #14638      +/-   ##
========================================================
- Coverage                 78.87%   78.85%   -0.03%     
========================================================
  Files                      1092     1092              
  Lines                    147404   147483      +79     
========================================================
+ Hits                     116270   116298      +28     
- Misses                    23886    23935      +49     
- Partials                   7248     7250       +2     
Flag Coverage Δ
unittests 78.85% <56.12%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -161,6 +161,22 @@ func UnlockVolumeUsingSealedKeyIfEncrypted(disk disks.Disk, name string, sealedE
return res, fmt.Errorf("internal error: cannot build an auth requestor: %v", err)
}

if loadedKey.SealedKeyV1 != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels like it's a leaky abstraction which only muddies the whole picture, could we do something more explicit, eg:

// legacy fde-hooks keys which did not carry any metadata
var legacyV1Key []byte
// more modern keys with metadata
var keys []*sb.KeyData

// isLegacyV1Key - simply checks the header

if fdeHasRevealKey() && isLegacyV1Key(sealedEncryptioKeyFile) {
	legacyV1Key, err = os.ReadFile()
	...
} else {
	if err := readKeyFile(sealedEncryptionKeyFile, loadedKey); err != nil {
		return res, err
	}
}

...
if len(legacyV1KeyFile) != 0 {

}
...
// continue with ActivateVolumeWithKeyData

and then simply drop the loader thingy

@bboozzoo bboozzoo dismissed their stale review October 18, 2024 15:51

code changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FDE Manager Pull requests that target FDE manager branch Run nested The PR also runs tests inluded in nested suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants