summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2015-06-02 16:34:45 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2015-06-02 16:34:45 +0200
commit8088df5425a68642e70ea41d299e7c915a463056 (patch)
tree2bf173f7ebca305f20bac241044e06eceb9e147d
parent0422a67eb0935e1dd96d602445ee179ef9dd993d (diff)
downloadgnutls-8088df5425a68642e70ea41d299e7c915a463056.tar.gz
tests: added PKCS #7 verification check with MD5
-rwxr-xr-xtests/cert-tests/pkcs718
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/cert-tests/pkcs7 b/tests/cert-tests/pkcs7
index 71ccf8c1a2..e43a96c1d1 100755
--- a/tests/cert-tests/pkcs7
+++ b/tests/cert-tests/pkcs7
@@ -150,6 +150,24 @@ if test "$rc" != "0"; then
exit $rc
fi
+# Test signing with broken algorithms
+FILE=signing-broken
+$VALGRIND $CERTTOOL --hash md5 --p7-sign --load-privkey $srcdir/../../doc/credentials/x509/key-rsa.pem --load-certificate $srcdir/../../doc/credentials/x509/cert-rsa.pem --infile pkcs7-detached.txt >$OUTFILE
+rc=$?
+
+if test "$rc" != "0"; then
+ echo "$FILE: PKCS7 struct signing failed"
+ exit $rc
+fi
+
+FILE=signing-verify-broken
+$VALGRIND $CERTTOOL --p7-verify --load-certificate $srcdir/../../doc/credentials/x509/cert-rsa.pem <$OUTFILE
+rc=$?
+
+if test "$rc" = "0"; then
+ echo "$FILE: PKCS7 struct verification succeeded with broken algo"
+ exit 1
+fi
rm -f $OUTFILE
rm -f $OUTFILE2