aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2020-06-23 12:25:33 -0700
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2020-06-23 12:25:33 -0700
commitfb39a370f4c44184319cd9c534673e501dcb6cc9 (patch)
tree9bbdf49b5098d928d68842b5cc57e2efc75a63fb
parent5601271d77fa8ed40d19a757e53bd7f09294f704 (diff)
downloadopenssl_tpm2_engine-fb39a370f4c44184319cd9c534673e501dcb6cc9.tar.gz
tests: add test for no password public keys
The openssl rsa and pkey commands will import a public engine key with the -pubin option, so add this and remove the password to exercise the new public key option. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rwxr-xr-xtests/check_auth.sh2
-rwxr-xr-xtests/check_counter_timer.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/check_auth.sh b/tests/check_auth.sh
index 542e709..632e97d 100755
--- a/tests/check_auth.sh
+++ b/tests/check_auth.sh
@@ -9,7 +9,7 @@ bindir=${srcdir}/..
# 3. encode a message using the TPM key
# 4. verify the message through the public key
${bindir}/create_tpm2_key -a -k passw0rd key2.tpm && \
-openssl rsa -engine tpm2 -inform engine -passin pass:passw0rd -in key2.tpm -pubout -out key2.pub && \
+openssl rsa -engine tpm2 -inform engine -pubin -in key2.tpm -pubout -out key2.pub && \
echo "This is a message" | openssl rsautl -sign -engine tpm2 -engine tpm2 -keyform engine -inkey key2.tpm -passin pass:passw0rd -out tmp.msg && \
openssl rsautl -verify -in tmp.msg -inkey key2.pub -pubin
diff --git a/tests/check_counter_timer.sh b/tests/check_counter_timer.sh
index 987eaf0..248aa06 100755
--- a/tests/check_counter_timer.sh
+++ b/tests/check_counter_timer.sh
@@ -28,7 +28,7 @@ echo "00080009" >> policy.txt
# 4. verify the message through the public key
##
${bindir}/create_tpm2_key key.tpm -a -k paSSW0RD -c policy.txt && \
-openssl rsa -engine tpm2 -inform engine -passin pass:paSSW0RD -in key.tpm -pubout -out key.pub && \
+openssl rsa -engine tpm2 -inform engine -pubin -in key.tpm -pubout -out key.pub && \
echo "policy counter timer" | openssl rsautl -sign -passin pass:paSSW0RD -engine tpm2 -engine tpm2 -keyform engine -inkey key.tpm -out tmp.msg && \
openssl rsautl -verify -in tmp.msg -inkey key.pub -pubin || exit 1