summaryrefslogtreecommitdiff
path: root/tests/cert-tests/certtool
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2015-04-08 17:07:11 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-04-08 17:07:11 +0200
commite946d98df253013a93a1059813da1cce12b24cd4 (patch)
treed522a611d356502079f740b860e5c68968e07680 /tests/cert-tests/certtool
parent6c32afa47ce2a34e90c2f507ab2a0f5bca9e61ee (diff)
downloadgnutls-e946d98df253013a93a1059813da1cce12b24cd4.tar.gz
tests: enhanced cert tests with SHA256 key IDs
Diffstat (limited to 'tests/cert-tests/certtool')
-rwxr-xr-xtests/cert-tests/certtool22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/cert-tests/certtool b/tests/cert-tests/certtool
index 39490f9250..cbabb59c0b 100755
--- a/tests/cert-tests/certtool
+++ b/tests/cert-tests/certtool
@@ -28,19 +28,35 @@ VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
fi
#check whether "funny" spaces can be interpreted
+id=`$VALGRIND $CERTTOOL --key-id --infile $srcdir/funny-spacing.pem --hash sha1`
+rc=$?
+
+if test "$id" != "1e09d707d4e3651b84dcb6c68a828d2affef7ec3";then
+ echo "Key-ID1 doesn't match the expected: $id"
+ exit 1
+fi
+
id=`$VALGRIND $CERTTOOL --key-id --infile $srcdir/funny-spacing.pem`
rc=$?
if test "$id" != "1e09d707d4e3651b84dcb6c68a828d2affef7ec3";then
- echo "Key-ID doesn't match the expected: 1"
+ echo "Default key-ID1 doesn't match the expected; did the defaults change? ID: $id"
exit 1
fi
-id=`$CERTTOOL --pubkey-info <$srcdir/funny-spacing.pem|$CERTTOOL --key-id`
+id=`$CERTTOOL --pubkey-info <$srcdir/funny-spacing.pem|$CERTTOOL --key-id --hash sha1`
rc=$?
if test "$id" != "1e09d707d4e3651b84dcb6c68a828d2affef7ec3";then
- echo "Key-ID doesn't match the expected: 2"
+ echo "Key-ID2 doesn't match the expected: $id"
+ exit 1
+fi
+
+id=`$CERTTOOL --pubkey-info <$srcdir/funny-spacing.pem|$CERTTOOL --key-id --hash sha256`
+rc=$?
+
+if test "$id" != "118e72e3655150c895ecbd19b3634179fb4a87c7a25abefcb11f5d66661d5a4d";then
+ echo "Key-ID3 doesn't match the expected: $id"
exit 1
fi