-
Notifications
You must be signed in to change notification settings - Fork 24
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
Do not merge (depends on storage-ng) - Supporting LUKS2 encryption by TPM2 device (jsc#PED-10703) #713
base: master
Are you sure you want to change the base?
Conversation
output.strip | ||
end | ||
|
||
# Enabe TPM2, if it is required |
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.
typo Enabe
|
||
begin | ||
Yast::Execute.on_target!("keyctl", "padd", "user", "cryptenroll", "@u", | ||
stdout: :capture, |
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.
why stdout is captured, when it is not used?
if entry.empty? | ||
"" | ||
else | ||
entry.first["title"] |
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 looks strange as you basically search for first entry, so it should look like
entry = @data.find { |d| d["id"] == @default }
entry ? entry["title"] : ""
log.warn "Invalid value #{value} trying to set as default. Fallback to default" | ||
value = "" | ||
entry = @data.select { |d| d["title"] == value } | ||
if entry.empty? |
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.
same here. The used method should not be select, but find that return first entry or nil.
@@ -155,7 +157,7 @@ def packages | |||
res = super | |||
res << ("grub2-" + grub2bls_architecture + "-efi-bls") | |||
res << "sdbootutil" | |||
res << "shim" if secure_boot | |||
res << "shim" |
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.
why this change is needed? I think there are architectures where shim is no available, but as it is grub2-bls architectures are already limited, os not sure.
def check_tpm2 | ||
return true unless Y2Storage::StorageManager.instance.encryption_use_tpm2 | ||
|
||
add_new_problem(_("This bootloader cannot handle encryption supported by a TPM2 device. ")) |
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.
so even our patched grub2 cannot handle tpm2 device?
Problem
We would like to give the user an easy way to use TPM2 devices for LUKS2 encrypted
partitions. (jsc#PED-10703)
The user can select TPM2 support for encryption in yast-storage-ng:
yast/yast-storage-ng#1406
Solution
Enrolling TPM2 with the given password, if the user has selected it.
Proposal: Selecting yast2-bls bootloader which supports TPM2.
Testing
Screenshots