Skip to content

Commit 5e91f98

Browse files
authored
Merge pull request #54 from jandryuk/stable-7-oxt-1130-password-rework-tpm2
STABLE-7: OXT-1130: Reuse owned TPM2
2 parents e21cadc + 4c13e1a commit 5e91f98

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

part2/stages/Functions/install-main

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,7 @@ is_mounted()
923923
}
924924

925925
# take ownership of TPM if necessary
926-
own_tpm()
927-
{
926+
own_tpm() {
928927
if [ "${TPM_STATE}" != "active" ]; then
929928
echo "TPM sate not active, canot own_tpm" >&2
930929
return 1
@@ -940,6 +939,15 @@ own_tpm()
940939
fi
941940
fi
942941

942+
if ! tpm_handles_defined; then
943+
local err
944+
945+
err=$( tpm_create_handles "${own_key}" ) || {
946+
echo "error creating TPM handles: ${err}" >&2
947+
return 1
948+
}
949+
fi
950+
943951
generate_policy "${own_key}"
944952

945953
return 0

0 commit comments

Comments
 (0)