-
Notifications
You must be signed in to change notification settings - Fork 17
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
crypt.go: allow adding names to legacy keyslots #349
base: master
Are you sure you want to change the base?
crypt.go: allow adding names to legacy keyslots #349
Conversation
f4304ad
to
74675a7
Compare
When reprovisioning with a newer snapd with old disks, we need to be able to convert old keyslots to new ones with names. Otherwise we cannot remove after reprovisioning is done.
74675a7
to
ae7dab0
Compare
This is used in canonical/snapd#14471 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did a quick pass
crypt.go
Outdated
// KeyslotAlreadyHasAName may be returned bv | ||
// NameLegacyLUKS2ContainerKey when trying to create a token for a | ||
// keyslot that already used by a token. | ||
var KeyslotAlreadyHasAName = errors.New("keyslot already has a name") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to end in Err to be consistent with golang naming conventions
crypt.go
Outdated
@@ -934,3 +934,60 @@ func RenameLUKS2ContainerKey(devicePath, oldName, newName string) error { | |||
|
|||
return nil | |||
} | |||
|
|||
// KeyslotAlreadyHasAName may be returned bv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/bv/by/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Oh, I've approved this but just realized that the tests fail because the code doesn't build:
https://github.com/canonical/secboot/actions/runs/12768290685/job/35588356655?pr=349#step:5:51 |
When reprovisioning with a newer snapd with old disks, we need to be able to convert old keyslots to new ones with names. Otherwise we cannot remove after reprovisioning is done.