aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-09-12 20:40:40 -0400
committerJack Lloyd <[email protected]>2015-09-12 20:40:40 -0400
commit8f732dccce692eaca509fc9732702df62cfa5c87 (patch)
tree0f78ae56e0ff9763e47aba33eb25f0b7b7ed8f5d /src/tests
parentdb937afe0b96d6fc06a477260d49694286749f9d (diff)
Add a test for X509_Certificate::fingerprint
Value checked against `openssl x509 -fingerprint` of same cert
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/unit_ecdsa.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tests/unit_ecdsa.cpp b/src/tests/unit_ecdsa.cpp
index 22625d230..9983de7cc 100644
--- a/src/tests/unit_ecdsa.cpp
+++ b/src/tests/unit_ecdsa.cpp
@@ -107,6 +107,7 @@ size_t test_decode_ecdsa_X509()
CHECK_MESSAGE(hex_encode(cert.serial_number()) == "01", "error reading serial from x509 ecdsa certificate");
CHECK_MESSAGE(hex_encode(cert.authority_key_id()) == "0096452DE588F966C4CCDF161DD1F3F5341B71E7", "error reading authority key id from x509 ecdsa certificate");
CHECK_MESSAGE(hex_encode(cert.subject_key_id()) == "0096452DE588F966C4CCDF161DD1F3F5341B71E7", "error reading Subject key id from x509 ecdsa certificate");
+ CHECK_MESSAGE(cert.fingerprint("SHA-1") == "32:42:1C:C3:EC:54:D7:E9:43:EC:51:F0:19:23:BD:85:1D:F2:1B:B9", "Incorrect fingerprint");
std::unique_ptr<X509_PublicKey> pubkey(cert.subject_public_key());
bool ver_ec = cert.check_signature(*pubkey);