summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2017-10-01 12:20:18 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2017-10-01 12:20:18 +0200
commit01e80acb56297c9fe114513e98d89939b2c21317 (patch)
treef4b5921bc5472a5b1fb32d57adf3385b91d7b3cb
parent4f1e92ce7d1ff463849c75cf4b7b505936fb359c (diff)
downloadgnutls-tmp-fix-sha512-use-in-certtool.tar.gz
tests: check whether key IDs with SHA512 are corrected calculatedtmp-fix-sha512-use-in-certtool
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rwxr-xr-xtests/cert-tests/certtool8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/cert-tests/certtool b/tests/cert-tests/certtool
index 3fd2398364..e9c62aa76f 100755
--- a/tests/cert-tests/certtool
+++ b/tests/cert-tests/certtool
@@ -65,6 +65,14 @@ if test "${id}" != "118e72e3655150c895ecbd19b3634179fb4a87c7a25abefcb11f5d66661d
exit 1
fi
+id=`"${CERTTOOL}" --pubkey-info <"${srcdir}/data/funny-spacing.pem"|"${CERTTOOL}" --key-id --hash sha512| tr -d '\r'`
+rc=$?
+
+if test "${id}" != "5e81ba533b1e7b88b3b0834a392c1cd63f8ccbe45f39edf4cb4b6a3e7700b333cfa386c54b1c5704a2b82a20dc417b347bb8f961c339134a91158a134ca6c478"; then
+ echo "Key-ID4 doesn't match the expected: ${id}"
+ exit 1
+fi
+
#fingerprint
id=`${VALGRIND} "${CERTTOOL}" --fingerprint --infile "${srcdir}/data/funny-spacing.pem"| tr -d '\r'`
rc=$?