diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-01-17 19:25:36 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-01-23 12:43:18 +0000 |
commit | afc49cf600197eda3bdc8e539855d431f4602895 (patch) | |
tree | af910679056d78598b82434b3627b21ec80b942d | |
parent | 33d4558d3ddf746a890d5b078b1a6a94e08b68ce (diff) | |
download | gnutls-afc49cf600197eda3bdc8e539855d431f4602895.tar.gz |
tests: check whether deletion of a certificate object works
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rwxr-xr-x | tests/suite/testpkcs11.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/suite/testpkcs11.sh b/tests/suite/testpkcs11.sh index d1158e857a..672ae791db 100755 --- a/tests/suite/testpkcs11.sh +++ b/tests/suite/testpkcs11.sh @@ -174,6 +174,23 @@ write_serv_cert () { # $1: token # $2: PIN +test_delete_cert () { + export GNUTLS_PIN="$2" + filename="$3" + token="$1" + + echo -n "* Deleting the server certificate... " + ${P11TOOL} ${ADDITIONAL_PARAM} --login --delete "${token};object=serv-cert;object-type=cert" >>"${TMPFILE}" 2>&1 + if test $? = 0; then + echo ok + else + echo failed + exit_error + fi +} + +# $1: token +# $2: PIN # $3: bits generate_rsa_privkey () { export GNUTLS_PIN="$2" @@ -906,6 +923,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_delete_cert "${TOKEN}" "${GNUTLS_PIN}" + test_sign_set_pin "${TOKEN}" "${GNUTLS_PIN}" if test ${RETCODE} = 0; then |