Skip to content
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

Add tpm2_z_srk (TPM2 version of tpm_z_srk) #7

Merged
merged 1 commit into from Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions sbin/tpm2_z_srk
@@ -0,0 +1,22 @@
#!/bin/sh

# Value recommended by TCG TPM v2.0 Provisioning Guidance
# https://trustedcomputinggroup.org/wp-content/uploads/TCG-TPM-v2.0-Provisioning-Guidance-Published-v1r1.pdf
# in Table 2
TPM2_SRK_HANDLE=0x81000001

log() {
echo "${0##*/}: $1" >&2
}


log "detecting whether SRK is password protected"

password_set=no
# empty input doesn't work
if ! echo | tpm2_create -Q -C "$TPM2_SRK_HANDLE" -i - 2>/dev/null; then
log "yes, SRK is password protected"
else
log "no, SRK isn't password protected"
echo -z
fi
3 changes: 2 additions & 1 deletion tpm-extra.spec.in
@@ -1,7 +1,7 @@
Name: tpm-extra
Version: @VERSION@
Release: 1%{?dist}
Summary: Command line tool for TPM PCR Extend operation
Summary: Additional tools not included in tpm-tools package.

Group: System
License: GPL
Expand Down Expand Up @@ -30,6 +30,7 @@ cp -r sbin $RPM_BUILD_ROOT/usr
%files
/usr/sbin/tpm_pcr_extend
/usr/sbin/tpm_z_srk
/usr/sbin/tpm2_z_srk
/usr/sbin/tpm_nvread_stdout
/usr/sbin/tpm_nvwrite_stdin
/usr/sbin/notty
Expand Down