summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-08-04 09:29:12 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-08-04 12:05:36 +0200
commit5b7abfd4b551b7c7b4594a806772eb2f5c31fbfb (patch)
tree68e77cdac9f3c3f875deabacc6d01e06342a9930
parent84b5e9971c2335b28348039c051572d9eea79389 (diff)
downloadgnutls-5b7abfd4b551b7c7b4594a806772eb2f5c31fbfb.tar.gz
tests: added unit test of generation of legal and illegal rsa-pss parameters
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rwxr-xr-xtests/key-tests/illegal-rsa18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/key-tests/illegal-rsa b/tests/key-tests/illegal-rsa
index 37d41d2c5c..1b9a162779 100755
--- a/tests/key-tests/illegal-rsa
+++ b/tests/key-tests/illegal-rsa
@@ -58,6 +58,24 @@ if test "${rc}" != "1"; then
exit ${rc}
fi
+#sanity generation
+${VALGRIND} "${CERTTOOL}" --generate-privkey --key-type rsa-pss --hash sha256 --salt-size 64 --bits 2048 >/dev/null
+rc=$?
+# We're done.
+if test "${rc}" != "0"; then
+ echo "Error in generating an RSA-PSS key"
+ exit ${rc}
+fi
+
+# generate illegal value
+${VALGRIND} "${CERTTOOL}" --generate-privkey --key-type rsa-pss --hash sha256 --salt-size 1024 --bits 2048 >/dev/null
+rc=$?
+# We're done.
+if test "${rc}" != "1"; then
+ echo "Error: allowed generation of an illegal key"
+ exit ${rc}
+fi
+
rm -f $TMPFILE
exit 0