Skip to content

Commit 129a772

Browse files
authored
Merge pull request #1566 from tlaurion/TPM_DUK_reuse_tpm_owner_pass
tpmr: fix TPM Disk Unlock Key which was not using proper cached TPM owner passphrase.
2 parents 25d7b06 + b4068e6 commit 129a772

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

initrd/bin/tpmr

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,13 +488,16 @@ tpm1_seal() {
488488
pcrf="$4"
489489
sealed_size="$5"
490490
pass="$6" # May be empty to seal with no password
491-
tpm_password="$7" # Owner password - will prompt if needed and not empty
491+
tpm_owner_password="$7" # Owner password - will prompt if needed and not empty
492492

493493
sealed_file="$SECRET_DIR/tpm1_seal_sealed.bin"
494494
at_exit cleanup_shred "$sealed_file"
495495

496496
POLICY_ARGS=()
497497

498+
DEBUG "tpm1_seal arguments: file=$file index=$index pcrl=$pcrl pcrf=$pcrf sealed_size=$sealed_size pass=$(mask_param "$pass") tpm_password=$(mask_param "$tpm_password")"
499+
500+
498501
# If a password was given, add it to the policy arguments
499502
if [ "$pass" ]; then
500503
POLICY_ARGS+=(-pwdd "$pass")
@@ -516,7 +519,7 @@ tpm1_seal() {
516519
-of "$sealed_file" \
517520
-hk 40000000 \
518521
"${POLICY_ARGS[@]}"
519-
522+
520523
# try it without the TPM Owner Password first
521524
if ! tpm nv_writevalue -in "$index" -if "$sealed_file"; then
522525
# to create an nvram space we need the TPM Owner Password
@@ -530,7 +533,7 @@ tpm1_seal() {
530533
prompt_tpm_owner_password
531534

532535
tpm nv_definespace -in "$index" -sz "$sealed_size" \
533-
-pwdo "$tpm_password" -per 0 ||
536+
-pwdo "$tpm_owner_password" -per 0 ||
534537
warn "Unable to define TPM NVRAM space; trying anyway"
535538

536539
tpm nv_writevalue -in "$index" -if "$sealed_file" ||

0 commit comments

Comments
 (0)