summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2018-02-14 15:59:50 +0000
committerjsing <>2018-02-14 15:59:50 +0000
commit77581c8395b0a7294b66eca50b2947a4ede24867 (patch)
tree1bf28c0b2bdb00a22d432890aebfa25950915021
parent4f48bcf2dc8ab6f6d746e6e5646d4f32f59d5d4b (diff)
downloadopenbsd-77581c8395b0a7294b66eca50b2947a4ede24867.tar.gz
openbsd-77581c8395b0a7294b66eca50b2947a4ede24867.tar.bz2
openbsd-77581c8395b0a7294b66eca50b2947a4ede24867.zip
Update keypair regress to match revised keypair hash handling.
Apparently I failed to commit this when I committed the libtls change...
-rw-r--r--src/regress/lib/libtls/keypair/keypairtest.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/regress/lib/libtls/keypair/keypairtest.c b/src/regress/lib/libtls/keypair/keypairtest.c
index 8a7774ff2c..718dcac8d9 100644
--- a/src/regress/lib/libtls/keypair/keypairtest.c
+++ b/src/regress/lib/libtls/keypair/keypairtest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: keypairtest.c,v 1.2 2018/02/08 10:19:57 jsing Exp $ */ 1/* $OpenBSD: keypairtest.c,v 1.3 2018/02/14 15:59:50 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2018 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -124,6 +124,11 @@ do_keypair_tests(void)
124 if (compare_mem("ocsp staple", ocsp_staple, ocsp_staple_len, 124 if (compare_mem("ocsp staple", ocsp_staple, ocsp_staple_len,
125 kp->ocsp_staple, kp->ocsp_staple_len) == -1) 125 kp->ocsp_staple, kp->ocsp_staple_len) == -1)
126 goto done; 126 goto done;
127 if (strcmp(kp->pubkey_hash, PUBKEY_HASH) != 0) {
128 fprintf(stderr, "FAIL: got pubkey hash '%s', want '%s'",
129 hash, PUBKEY_HASH);
130 goto done;
131 }
127 132
128 tls_keypair_clear(kp); 133 tls_keypair_clear(kp);
129 134
@@ -148,15 +153,15 @@ do_keypair_tests(void)
148 goto done; 153 goto done;
149 } 154 }
150 155
151 if (tls_keypair_set_cert_mem(kp, cert, cert_len) == -1) { 156 if (tls_keypair_set_cert_mem(kp, &err, cert, cert_len) == -1) {
152 fprintf(stderr, "FAIL: failed to load cert: %s\n", err.msg); 157 fprintf(stderr, "FAIL: failed to load cert: %s\n", err.msg);
153 goto done; 158 goto done;
154 } 159 }
155 if (tls_keypair_set_key_mem(kp, key, key_len) == -1) { 160 if (tls_keypair_set_key_mem(kp, &err, key, key_len) == -1) {
156 fprintf(stderr, "FAIL: failed to load key: %s\n", err.msg); 161 fprintf(stderr, "FAIL: failed to load key: %s\n", err.msg);
157 goto done; 162 goto done;
158 } 163 }
159 if (tls_keypair_set_ocsp_staple_mem(kp, ocsp_staple, 164 if (tls_keypair_set_ocsp_staple_mem(kp, &err, ocsp_staple,
160 ocsp_staple_len) == -1) { 165 ocsp_staple_len) == -1) {
161 fprintf(stderr, "FAIL: failed to load ocsp staple: %s\n", err.msg); 166 fprintf(stderr, "FAIL: failed to load ocsp staple: %s\n", err.msg);
162 goto done; 167 goto done;
@@ -169,13 +174,7 @@ do_keypair_tests(void)
169 if (compare_mem("ocsp staple", ocsp_staple, ocsp_staple_len, 174 if (compare_mem("ocsp staple", ocsp_staple, ocsp_staple_len,
170 kp->ocsp_staple, kp->ocsp_staple_len) == -1) 175 kp->ocsp_staple, kp->ocsp_staple_len) == -1)
171 goto done; 176 goto done;
172 177 if (strcmp(kp->pubkey_hash, PUBKEY_HASH) != 0) {
173 if (tls_keypair_pubkey_hash(kp, &err, &hash) == -1) {
174 fprintf(stderr, "FAIL: failed to generate keypair hash: %s\n",
175 err.msg);
176 goto done;
177 }
178 if (strcmp(hash, PUBKEY_HASH) != 0) {
179 fprintf(stderr, "FAIL: got pubkey hash '%s', want '%s'", 178 fprintf(stderr, "FAIL: got pubkey hash '%s', want '%s'",
180 hash, PUBKEY_HASH); 179 hash, PUBKEY_HASH);
181 goto done; 180 goto done;