-
Notifications
You must be signed in to change notification settings - Fork 59
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
tests: Add script to generate IAK and IDevID certificates #883
Conversation
8513fde
to
d3fae5b
Compare
82c1f6c
to
89cff6e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it looks good to me. I would run it through shellcheck
and work on the "double quote to prevent globbing and word splitting" warnings, as they usually make sense for at least for paths.
89cff6e
to
c1cf781
Compare
Fixed the issues reported by |
The script generates a test root CA and intermediate CA keys and certificates. The output directory can be set via the --output option, and the CA password with the --pwd option. If an output directory is not set, a temporary directory is created and the certificates are placed there. Then, the script generates the IDevID and IAK keys inside the TPM and respective certificates. The script requires the tpm2-openssl provider to access the keys inside the TPM. It is recommended to set the TCTI, TPM2TOOLS_TCTI, and TPM2OPENSSL_TCTI environment variables to set which TPM to use when running the script. If these variables are not set, the default value `device:/dev/tpmrm0` is used instead. This also modifies the tests/setup_swtpm.sh and tests/run.sh to configure the TPM2OPENSSL_TCTI to use the swtpm with the tpm2-openssl provider. Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
c1cf781
to
47dc78d
Compare
The script generates a test root CA and intermediate CA keys and certificates. The output directory can be set via the
--output
option, and the CA password with the--pwd
option. If an output directory is not set, a temporary directory is created and the certificates are placed there.Then, the script generates the IDevID and IAK keys inside the TPM and respective certificates.
The script requires the
tpm2-openssl
provider to access the keys inside the TPM.It is recommended to setup the TCTI, TPM2TOOLS_TCTI, and TPM2OPENSSL_TCTI environment variables to select the TPM to use. If not set, the default
/dev/tpmrm0
will be used instead.This also modifies the
tests/setup_swtpm.sh
andtests/run.sh
to configure the TPM2OPENSSL_TCTI to use theswtpm
with thetpm2-openssl
provider.This is based on the test contributed by @Isaac-Matthews on https://github.com/RedHat-SP-Security/keylime-tests