Enhance tpm-bootstrap-1password.sh with progress logging for key creation and sealing

This commit is contained in:
2026-08-29 19:23:29 +02:00
parent 91f1abef8a
commit 949b5763fc
+5
View File
@@ -88,13 +88,16 @@ PASSWORD="$(op read "$OP_SECRET_REFERENCE")"
exit 1
}
echo "Creating primary key..." >&2
tpm2_createprimary -C o -c "$WORKDIR/primary.ctx" -Q
echo "Creating PCR policy for ${PCR_LIST}..." >&2
tpm2_createpolicy -Q \
--policy-pcr \
-l "$PCR_LIST" \
-L "$WORKDIR/policy.digest"
echo "Sealing password..." >&2
printf '%s' "$PASSWORD" | tpm2_create \
-C "$WORKDIR/primary.ctx" \
-L "$WORKDIR/policy.digest" \
@@ -105,6 +108,7 @@ printf '%s' "$PASSWORD" | tpm2_create \
unset PASSWORD
echo "Loading sealed object..." >&2
tpm2_load \
-C "$WORKDIR/primary.ctx" \
-u "$WORKDIR/seal.pub" \
@@ -112,6 +116,7 @@ tpm2_load \
-c "$WORKDIR/seal.ctx" \
-Q
echo "Persisting sealed object at ${HANDLE}..." >&2
tpm2_evictcontrol -C o -c "$WORKDIR/seal.ctx" "$HANDLE" >/dev/null
echo "Password from ${OP_SECRET_REFERENCE} sealed and persisted at handle ${HANDLE}, bound to PCRs ${PCR_LIST}"