diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2018-02-14 15:59:51 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2018-02-14 15:59:51 +0000 |
commit | 3d0df229bcf676aa5fa15d911539ecd9ad3c8d73 (patch) | |
tree | 2562098d7a080b44d84302a85b14d36146dd4001 /regress/lib | |
parent | 1b54c2c26640844f4fbe4f61f06afb148375079e (diff) |
Update keypair regress to match revised keypair hash handling.
Apparently I failed to commit this when I committed the libtls change...
Diffstat (limited to 'regress/lib')
-rw-r--r-- | regress/lib/libtls/keypair/keypairtest.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/regress/lib/libtls/keypair/keypairtest.c b/regress/lib/libtls/keypair/keypairtest.c index 8a7774ff2ca..718dcac8d9e 100644 --- a/regress/lib/libtls/keypair/keypairtest.c +++ b/regress/lib/libtls/keypair/keypairtest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keypairtest.c,v 1.2 2018/02/08 10:19:57 jsing Exp $ */ +/* $OpenBSD: keypairtest.c,v 1.3 2018/02/14 15:59:50 jsing Exp $ */ /* * Copyright (c) 2018 Joel Sing <jsing@openbsd.org> * @@ -124,6 +124,11 @@ do_keypair_tests(void) if (compare_mem("ocsp staple", ocsp_staple, ocsp_staple_len, kp->ocsp_staple, kp->ocsp_staple_len) == -1) goto done; + if (strcmp(kp->pubkey_hash, PUBKEY_HASH) != 0) { + fprintf(stderr, "FAIL: got pubkey hash '%s', want '%s'", + hash, PUBKEY_HASH); + goto done; + } tls_keypair_clear(kp); @@ -148,15 +153,15 @@ do_keypair_tests(void) goto done; } - if (tls_keypair_set_cert_mem(kp, cert, cert_len) == -1) { + if (tls_keypair_set_cert_mem(kp, &err, cert, cert_len) == -1) { fprintf(stderr, "FAIL: failed to load cert: %s\n", err.msg); goto done; } - if (tls_keypair_set_key_mem(kp, key, key_len) == -1) { + if (tls_keypair_set_key_mem(kp, &err, key, key_len) == -1) { fprintf(stderr, "FAIL: failed to load key: %s\n", err.msg); goto done; } - if (tls_keypair_set_ocsp_staple_mem(kp, ocsp_staple, + if (tls_keypair_set_ocsp_staple_mem(kp, &err, ocsp_staple, ocsp_staple_len) == -1) { fprintf(stderr, "FAIL: failed to load ocsp staple: %s\n", err.msg); goto done; @@ -169,13 +174,7 @@ do_keypair_tests(void) if (compare_mem("ocsp staple", ocsp_staple, ocsp_staple_len, kp->ocsp_staple, kp->ocsp_staple_len) == -1) goto done; - - if (tls_keypair_pubkey_hash(kp, &err, &hash) == -1) { - fprintf(stderr, "FAIL: failed to generate keypair hash: %s\n", - err.msg); - goto done; - } - if (strcmp(hash, PUBKEY_HASH) != 0) { + if (strcmp(kp->pubkey_hash, PUBKEY_HASH) != 0) { fprintf(stderr, "FAIL: got pubkey hash '%s', want '%s'", hash, PUBKEY_HASH); goto done; |