summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-08-25 11:41:47 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2017-08-27 15:58:28 +0200
commit9622d8e1f13d516167e290bbc6ae4fc15f2bc63c (patch)
treece8a2b653bd178ce88bf5fee33adada960976a8e
parent8c71c2d9bcd72a9b3b6d0e69fa0a1362d18ce350 (diff)
downloadgnutls-9622d8e1f13d516167e290bbc6ae4fc15f2bc63c.tar.gz
tests: check whether p11tool signing with RSA-PSS works
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rwxr-xr-xtests/suite/testpkcs11.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/suite/testpkcs11.sh b/tests/suite/testpkcs11.sh
index d2276d4d83..1f38f3acc0 100755
--- a/tests/suite/testpkcs11.sh
+++ b/tests/suite/testpkcs11.sh
@@ -696,6 +696,20 @@ test_sign () {
fi
echo ok
+ echo -n "* Testing RSA-PSS signatures using the private key... "
+ ${P11TOOL} ${ADDITIONAL_PARAM} --login --sign-params rsa-pss --test-sign "${token};object=serv-key" >>"${TMPFILE}" 2>&1
+ rc=$?
+ if test $rc != 0; then
+ if test $rc = 2; then
+ echo "failed. RSA-PSS not supported."
+ else
+ echo "failed. Cannot test signatures."
+ exit_error
+ fi
+ else
+ echo ok
+ fi
+
echo -n "* Testing signatures using the private key (with ID)... "
${P11TOOL} ${ADDITIONAL_PARAM} --login --test-sign "${token};id=%ac%1d%7a%39%cb%72%17%94%66%6c%74%44%73%40%91%44%c0%a0%43%7d" >>"${TMPFILE}" 2>&1
${P11TOOL} ${ADDITIONAL_PARAM} --login --test-sign "${token};id=%ac%1d%7a%39%cb%72%17%94%66%6c%74%44%73%40%91%44%c0%a0%43%7d" 2>&1|grep "Verifying against public key in the token..."|grep ok >>"${TMPFILE}" 2>&1