summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-06-23 16:56:43 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-06-23 16:57:42 +0200
commit78dd58449740adabf7915bc9aea72b7eb9f4e7ac (patch)
tree66833440817ba4e1e18b3ffdfe7e006eba7bee0f
parentbcfc9040759fa0b83aa66f8c637203ca6fb27890 (diff)
downloadgnutls-78dd58449740adabf7915bc9aea72b7eb9f4e7ac.tar.gz
tests: added test for DSA private key generation
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rwxr-xr-xtests/suite/testpkcs1116
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/suite/testpkcs11 b/tests/suite/testpkcs11
index 8b6895b66f..71a58c358b 100755
--- a/tests/suite/testpkcs11
+++ b/tests/suite/testpkcs11
@@ -128,6 +128,21 @@ generate_rsa_privkey () {
fi
}
+generate_dsa_privkey () {
+ export GNUTLS_PIN=$2
+ token=$1
+ bits=$3
+
+ echo -n "* Generating DSA private key ($bits)... "
+ $P11TOOL $ADDITIONAL_PARAM --login --id 000102030405 --label gnutls-client-dsa --generate-dsa --bits $bits "$token" >>$TMPFILE 2>&1
+ if test $? = 0;then
+ echo ok
+ else
+ echo failed
+ exit 1
+ fi
+}
+
# $1: token
# $2: PIN
# $3: bits
@@ -444,6 +459,7 @@ delete_temp_privkey $TOKEN $GNUTLS_PIN
#export_pubkey_of_privkey $TOKEN $GNUTLS_PIN
+generate_dsa_privkey $TOKEN $GNUTLS_PIN 1024
generate_rsa_privkey $TOKEN $GNUTLS_PIN 1024
change_id_of_privkey $TOKEN $GNUTLS_PIN
change_label_of_privkey $TOKEN $GNUTLS_PIN