diff options
Diffstat (limited to 'tests/suite/testpkcs11.sh')
-rwxr-xr-x | tests/suite/testpkcs11.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/suite/testpkcs11.sh b/tests/suite/testpkcs11.sh index dcf932c7fc..199e2cb5c1 100755 --- a/tests/suite/testpkcs11.sh +++ b/tests/suite/testpkcs11.sh @@ -735,6 +735,24 @@ test_sign () { echo ok } +# This tests the signing operation as well as the usage of --set-pin +test_sign_set_pin () { + pin="$2" + token="$1" + + unset GNUTLS_PIN + + echo -n "* Testing signatures using the private key and --set-pin... " + ${P11TOOL} ${ADDITIONAL_PARAM} --login --set-pin ${pin} --test-sign "${token};object=serv-key" >>"${TMPFILE}" 2>&1 + if test $? != 0; then + echo "failed. Cannot test signatures." + exit_error + fi + echo ok + + export GNUTLS_PIN=${pin} +} + # $1: token # $2: PIN # $3: certfile @@ -857,6 +875,8 @@ write_certificate_id_test_rsa "${TOKEN}" "${GNUTLS_PIN}" "${srcdir}/pkcs11-certs write_certificate_id_test_rsa2 "${TOKEN}" "${GNUTLS_PIN}" "${srcdir}/pkcs11-certs/ca.key" "${srcdir}/pkcs11-certs/ca.crt" write_certificate_id_test_ecdsa "${TOKEN}" "${GNUTLS_PIN}" "${srcdir}/pkcs11-certs/ca.key" "${srcdir}/pkcs11-certs/ca.crt" +test_sign_set_pin "${TOKEN}" "${GNUTLS_PIN}" + if test ${RETCODE} = 0; then echo "* All smart cards tests succeeded" fi |