forked from osresearch/safeboot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tpm2-attest: fetch the TPM OEM certs as part of building the package
- Loading branch information
1 parent
d1ff64f
commit c9626a3
Showing
4 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
# Fetch vendor certificates and build the OpenSSL CApath structure | ||
# so that TPM Endorsement Keys can be validated. | ||
# | ||
# shellcheck disable=SC2013 | ||
DIR="$(dirname "$0")" | ||
|
||
if [ -n "$1" ]; then | ||
DIR="$1" | ||
fi | ||
|
||
CERTS="$DIR/tpm-certs.txt" | ||
CERTDIR="$DIR/certs" | ||
|
||
mkdir -p "$CERTDIR" | ||
|
||
for url in $(awk '{print $1}' "$CERTS"); do | ||
echo "$url" | ||
curl --silent "$url" \ | ||
| openssl x509 \ | ||
-inform "DER" \ | ||
-outform "PEM" \ | ||
-out "$CERTDIR/$(basename "$url" .crt).pem" \ | ||
|| die "$url: failed" | ||
done | ||
|
||
echo >&2 "Rebuilding symlinks" | ||
c_rehash "$DIR/certs" | ||
|
||
# Make the roots.pem file from the ones flagged as trusted roots | ||
# in the certs list | ||
for url in $(awk '/ trusted$/ {print $1}' "$CERTS"); do | ||
cat "$CERTDIR/$(basename "$url" .crt).pem" | ||
done > "$CERTDIR/roots.pem" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
https://secure.globalsign.com/cacert/gstpmroot.crt trusted | ||
https://secure.globalsign.com/cacert/stmtpmekroot.crt | ||
https://secure.globalsign.com/cacert/stmtpmekint01.crt | ||
https://secure.globalsign.com/cacert/stmtpmekint02.crt | ||
https://secure.globalsign.com/cacert/stmtpmekint03.crt | ||
https://secure.globalsign.com/cacert/stmtpmekint04.crt | ||
https://secure.globalsign.com/cacert/stmtpmekint05.crt | ||
https://secure.globalsign.com/cacert/stmtpmekint06.crt | ||
https://secure.globalsign.com/cacert/stmtpmekint07.crt |