summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjsing <>2022-01-08 12:43:45 +0000
committerjsing <>2022-01-08 12:43:45 +0000
commitdc6c56e417f73129ab2e1f477f2816f0cb654ff5 (patch)
tree8a7527e5b21283646513b32c21a84fef811d965b /src/lib
parent28e3801f3f0182c33d771dcddd72a444055cc7a1 (diff)
downloadopenbsd-dc6c56e417f73129ab2e1f477f2816f0cb654ff5.tar.gz
openbsd-dc6c56e417f73129ab2e1f477f2816f0cb654ff5.tar.bz2
openbsd-dc6c56e417f73129ab2e1f477f2816f0cb654ff5.zip
Rename CERT to SSL_CERT and CERT_PKEY to SSL_CERT_PKEY.
Nearly all structs in libssl start with an SSL_ suffix, rename CERT and CERT_PKEY for consistency. ok inoguchi@ tb@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libssl/s3_lib.c4
-rw-r--r--src/lib/libssl/ssl_both.c4
-rw-r--r--src/lib/libssl/ssl_cert.c26
-rw-r--r--src/lib/libssl/ssl_lib.c26
-rw-r--r--src/lib/libssl/ssl_locl.h90
-rw-r--r--src/lib/libssl/ssl_rsa.c18
-rw-r--r--src/lib/libssl/ssl_srvr.c4
-rw-r--r--src/lib/libssl/t1_lib.c6
-rw-r--r--src/lib/libssl/tls13_client.c12
-rw-r--r--src/lib/libssl/tls13_server.c12
10 files changed, 101 insertions, 101 deletions
diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c
index 1ede113cbb..39a4682d10 100644
--- a/src/lib/libssl/s3_lib.c
+++ b/src/lib/libssl/s3_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_lib.c,v 1.223 2022/01/07 16:45:06 jsing Exp $ */ 1/* $OpenBSD: s3_lib.c,v 1.224 2022/01/08 12:43:44 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -2486,7 +2486,7 @@ ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt,
2486 SSL_CIPHER *c, *ret = NULL; 2486 SSL_CIPHER *c, *ret = NULL;
2487 int can_use_ecc; 2487 int can_use_ecc;
2488 int i, ii, ok; 2488 int i, ii, ok;
2489 CERT *cert; 2489 SSL_CERT *cert;
2490 2490
2491 /* Let's see which ciphers we can support */ 2491 /* Let's see which ciphers we can support */
2492 cert = s->cert; 2492 cert = s->cert;
diff --git a/src/lib/libssl/ssl_both.c b/src/lib/libssl/ssl_both.c
index 62652f8406..9894648db8 100644
--- a/src/lib/libssl/ssl_both.c
+++ b/src/lib/libssl/ssl_both.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_both.c,v 1.39 2021/11/26 16:41:42 tb Exp $ */ 1/* $OpenBSD: ssl_both.c,v 1.40 2022/01/08 12:43:44 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -334,7 +334,7 @@ ssl3_add_cert(CBB *cbb, X509 *x)
334} 334}
335 335
336int 336int
337ssl3_output_cert_chain(SSL *s, CBB *cbb, CERT_PKEY *cpk) 337ssl3_output_cert_chain(SSL *s, CBB *cbb, SSL_CERT_PKEY *cpk)
338{ 338{
339 X509_STORE_CTX *xs_ctx = NULL; 339 X509_STORE_CTX *xs_ctx = NULL;
340 STACK_OF(X509) *chain; 340 STACK_OF(X509) *chain;
diff --git a/src/lib/libssl/ssl_cert.c b/src/lib/libssl/ssl_cert.c
index 173e217c8f..c735547393 100644
--- a/src/lib/libssl/ssl_cert.c
+++ b/src/lib/libssl/ssl_cert.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_cert.c,v 1.91 2022/01/07 16:45:06 jsing Exp $ */ 1/* $OpenBSD: ssl_cert.c,v 1.92 2022/01/08 12:43:44 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -158,12 +158,12 @@ SSL_get_ex_data_X509_STORE_CTX_idx(void)
158 return ssl_x509_store_ctx_idx; 158 return ssl_x509_store_ctx_idx;
159} 159}
160 160
161CERT * 161SSL_CERT *
162ssl_cert_new(void) 162ssl_cert_new(void)
163{ 163{
164 CERT *ret; 164 SSL_CERT *ret;
165 165
166 ret = calloc(1, sizeof(CERT)); 166 ret = calloc(1, sizeof(SSL_CERT));
167 if (ret == NULL) { 167 if (ret == NULL) {
168 SSLerrorx(ERR_R_MALLOC_FAILURE); 168 SSLerrorx(ERR_R_MALLOC_FAILURE);
169 return (NULL); 169 return (NULL);
@@ -173,13 +173,13 @@ ssl_cert_new(void)
173 return (ret); 173 return (ret);
174} 174}
175 175
176CERT * 176SSL_CERT *
177ssl_cert_dup(CERT *cert) 177ssl_cert_dup(SSL_CERT *cert)
178{ 178{
179 CERT *ret; 179 SSL_CERT *ret;
180 int i; 180 int i;
181 181
182 ret = calloc(1, sizeof(CERT)); 182 ret = calloc(1, sizeof(SSL_CERT));
183 if (ret == NULL) { 183 if (ret == NULL) {
184 SSLerrorx(ERR_R_MALLOC_FAILURE); 184 SSLerrorx(ERR_R_MALLOC_FAILURE);
185 return (NULL); 185 return (NULL);
@@ -269,7 +269,7 @@ ssl_cert_dup(CERT *cert)
269 269
270 270
271void 271void
272ssl_cert_free(CERT *c) 272ssl_cert_free(SSL_CERT *c)
273{ 273{
274 int i; 274 int i;
275 275
@@ -292,7 +292,7 @@ ssl_cert_free(CERT *c)
292} 292}
293 293
294int 294int
295ssl_cert_set0_chain(CERT *c, STACK_OF(X509) *chain) 295ssl_cert_set0_chain(SSL_CERT *c, STACK_OF(X509) *chain)
296{ 296{
297 if (c->key == NULL) 297 if (c->key == NULL)
298 return 0; 298 return 0;
@@ -304,7 +304,7 @@ ssl_cert_set0_chain(CERT *c, STACK_OF(X509) *chain)
304} 304}
305 305
306int 306int
307ssl_cert_set1_chain(CERT *c, STACK_OF(X509) *chain) 307ssl_cert_set1_chain(SSL_CERT *c, STACK_OF(X509) *chain)
308{ 308{
309 STACK_OF(X509) *new_chain = NULL; 309 STACK_OF(X509) *new_chain = NULL;
310 310
@@ -321,7 +321,7 @@ ssl_cert_set1_chain(CERT *c, STACK_OF(X509) *chain)
321} 321}
322 322
323int 323int
324ssl_cert_add0_chain_cert(CERT *c, X509 *cert) 324ssl_cert_add0_chain_cert(SSL_CERT *c, X509 *cert)
325{ 325{
326 if (c->key == NULL) 326 if (c->key == NULL)
327 return 0; 327 return 0;
@@ -337,7 +337,7 @@ ssl_cert_add0_chain_cert(CERT *c, X509 *cert)
337} 337}
338 338
339int 339int
340ssl_cert_add1_chain_cert(CERT *c, X509 *cert) 340ssl_cert_add1_chain_cert(SSL_CERT *c, X509 *cert)
341{ 341{
342 if (!ssl_cert_add0_chain_cert(c, cert)) 342 if (!ssl_cert_add0_chain_cert(c, cert))
343 return 0; 343 return 0;
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c
index 4fe7fb58dc..64b1806238 100644
--- a/src/lib/libssl/ssl_lib.c
+++ b/src/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_lib.c,v 1.281 2022/01/07 16:45:06 jsing Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.282 2022/01/08 12:43:44 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -912,7 +912,7 @@ SSL_get0_verified_chain(const SSL *s)
912int 912int
913SSL_copy_session_id(SSL *t, const SSL *f) 913SSL_copy_session_id(SSL *t, const SSL *f)
914{ 914{
915 CERT *tmp; 915 SSL_CERT *tmp;
916 916
917 /* Do we need to do SSL locking? */ 917 /* Do we need to do SSL locking? */
918 if (!SSL_set_session(t, SSL_get_session(f))) 918 if (!SSL_set_session(t, SSL_get_session(f)))
@@ -2187,10 +2187,10 @@ SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth)
2187} 2187}
2188 2188
2189void 2189void
2190ssl_set_cert_masks(CERT *c, const SSL_CIPHER *cipher) 2190ssl_set_cert_masks(SSL_CERT *c, const SSL_CIPHER *cipher)
2191{ 2191{
2192 unsigned long mask_a, mask_k; 2192 unsigned long mask_a, mask_k;
2193 CERT_PKEY *cpk; 2193 SSL_CERT_PKEY *cpk;
2194 2194
2195 if (c == NULL) 2195 if (c == NULL)
2196 return; 2196 return;
@@ -2259,12 +2259,12 @@ ssl_check_srvr_ecc_cert_and_alg(X509 *x, SSL *s)
2259 return (1); 2259 return (1);
2260} 2260}
2261 2261
2262CERT_PKEY * 2262SSL_CERT_PKEY *
2263ssl_get_server_send_pkey(const SSL *s) 2263ssl_get_server_send_pkey(const SSL *s)
2264{ 2264{
2265 unsigned long alg_a; 2265 unsigned long alg_a;
2266 CERT *c; 2266 SSL_CERT *c;
2267 int i; 2267 int i;
2268 2268
2269 c = s->cert; 2269 c = s->cert;
2270 ssl_set_cert_masks(c, S3I(s)->hs.cipher); 2270 ssl_set_cert_masks(c, S3I(s)->hs.cipher);
@@ -2291,9 +2291,9 @@ ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher, const EVP_MD **pmd,
2291{ 2291{
2292 const struct ssl_sigalg *sigalg = NULL; 2292 const struct ssl_sigalg *sigalg = NULL;
2293 EVP_PKEY *pkey = NULL; 2293 EVP_PKEY *pkey = NULL;
2294 unsigned long alg_a; 2294 unsigned long alg_a;
2295 CERT *c; 2295 SSL_CERT *c;
2296 int idx = -1; 2296 int idx = -1;
2297 2297
2298 alg_a = cipher->algorithm_auth; 2298 alg_a = cipher->algorithm_auth;
2299 c = s->cert; 2299 c = s->cert;
@@ -2322,7 +2322,7 @@ ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher, const EVP_MD **pmd,
2322size_t 2322size_t
2323ssl_dhe_params_auto_key_bits(SSL *s) 2323ssl_dhe_params_auto_key_bits(SSL *s)
2324{ 2324{
2325 CERT_PKEY *cpk; 2325 SSL_CERT_PKEY *cpk;
2326 int key_bits; 2326 int key_bits;
2327 2327
2328 if (s->cert->dhe_params_auto == 2) { 2328 if (s->cert->dhe_params_auto == 2) {
@@ -2974,7 +2974,7 @@ SSL_get_SSL_CTX(const SSL *ssl)
2974SSL_CTX * 2974SSL_CTX *
2975SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx) 2975SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx)
2976{ 2976{
2977 CERT *new_cert; 2977 SSL_CERT *new_cert;
2978 2978
2979 if (ctx == NULL) 2979 if (ctx == NULL)
2980 ctx = ssl->initial_ctx; 2980 ctx = ssl->initial_ctx;
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h
index 5361704d70..e8c277ec60 100644
--- a/src/lib/libssl/ssl_locl.h
+++ b/src/lib/libssl/ssl_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_locl.h,v 1.376 2022/01/07 16:45:06 jsing Exp $ */ 1/* $OpenBSD: ssl_locl.h,v 1.377 2022/01/08 12:43:44 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -361,6 +361,34 @@ __BEGIN_HIDDEN_DECLS
361#define EXPLICIT_CHAR2_CURVE_TYPE 2 361#define EXPLICIT_CHAR2_CURVE_TYPE 2
362#define NAMED_CURVE_TYPE 3 362#define NAMED_CURVE_TYPE 3
363 363
364typedef struct ssl_cert_pkey_st {
365 X509 *x509;
366 EVP_PKEY *privatekey;
367 STACK_OF(X509) *chain;
368} SSL_CERT_PKEY;
369
370typedef struct ssl_cert_st {
371 /* Current active set */
372 /* ALWAYS points to an element of the pkeys array
373 * Probably it would make more sense to store
374 * an index, not a pointer. */
375 SSL_CERT_PKEY *key;
376
377 SSL_CERT_PKEY pkeys[SSL_PKEY_NUM];
378
379 /* The following masks are for the key and auth
380 * algorithms that are supported by the certs below */
381 int valid;
382 unsigned long mask_k;
383 unsigned long mask_a;
384
385 DH *dhe_params;
386 DH *(*dhe_params_cb)(SSL *ssl, int is_export, int keysize);
387 int dhe_params_auto;
388
389 int references; /* >1 only if SSL_copy_session_id is used */
390} SSL_CERT;
391
364struct ssl_comp_st { 392struct ssl_comp_st {
365 int id; 393 int id;
366 const char *name; 394 const char *name;
@@ -498,12 +526,6 @@ struct ssl_session_st {
498 uint16_t *tlsext_supportedgroups; /* peer's list */ 526 uint16_t *tlsext_supportedgroups; /* peer's list */
499}; 527};
500 528
501typedef struct cert_pkey_st {
502 X509 *x509;
503 EVP_PKEY *privatekey;
504 STACK_OF(X509) *chain;
505} CERT_PKEY;
506
507struct ssl_sigalg; 529struct ssl_sigalg;
508 530
509typedef struct ssl_handshake_tls12_st { 531typedef struct ssl_handshake_tls12_st {
@@ -533,7 +555,7 @@ typedef struct ssl_handshake_tls13_st {
533 int hrr; 555 int hrr;
534 556
535 /* Certificate selected for use (static pointer). */ 557 /* Certificate selected for use (static pointer). */
536 const CERT_PKEY *cpk; 558 const SSL_CERT_PKEY *cpk;
537 559
538 /* Version proposed by peer server. */ 560 /* Version proposed by peer server. */
539 uint16_t server_version; 561 uint16_t server_version;
@@ -785,7 +807,7 @@ typedef struct ssl_ctx_internal_st {
785 807
786 STACK_OF(SSL_CIPHER) *cipher_list_tls13; 808 STACK_OF(SSL_CIPHER) *cipher_list_tls13;
787 809
788 struct cert_st /* CERT */ *cert; 810 SSL_CERT *cert;
789 811
790 /* Default values used when no per-SSL value is defined follow */ 812 /* Default values used when no per-SSL value is defined follow */
791 813
@@ -1058,7 +1080,7 @@ struct ssl_st {
1058 STACK_OF(SSL_CIPHER) *cipher_list; 1080 STACK_OF(SSL_CIPHER) *cipher_list;
1059 1081
1060 /* This is used to hold the server certificate used */ 1082 /* This is used to hold the server certificate used */
1061 struct cert_st /* CERT */ *cert; 1083 SSL_CERT *cert;
1062 1084
1063 /* the session_id_context is used to ensure sessions are only reused 1085 /* the session_id_context is used to ensure sessions are only reused
1064 * in the appropriate context */ 1086 * in the appropriate context */
@@ -1200,38 +1222,16 @@ typedef struct ssl3_state_st {
1200 struct ssl3_state_internal_st *internal; 1222 struct ssl3_state_internal_st *internal;
1201} SSL3_STATE; 1223} SSL3_STATE;
1202 1224
1203typedef struct cert_st {
1204 /* Current active set */
1205 CERT_PKEY *key; /* ALWAYS points to an element of the pkeys array
1206 * Probably it would make more sense to store
1207 * an index, not a pointer. */
1208
1209 /* The following masks are for the key and auth
1210 * algorithms that are supported by the certs below */
1211 int valid;
1212 unsigned long mask_k;
1213 unsigned long mask_a;
1214
1215 DH *dhe_params;
1216 DH *(*dhe_params_cb)(SSL *ssl, int is_export, int keysize);
1217 int dhe_params_auto;
1218
1219 CERT_PKEY pkeys[SSL_PKEY_NUM];
1220
1221 int references; /* >1 only if SSL_copy_session_id is used */
1222} CERT;
1223
1224
1225typedef struct sess_cert_st { 1225typedef struct sess_cert_st {
1226 STACK_OF(X509) *cert_chain; /* as received from peer */ 1226 STACK_OF(X509) *cert_chain; /* as received from peer */
1227 1227
1228 /* The 'peer_...' members are used only by clients. */ 1228 /* The 'peer_...' members are used only by clients. */
1229 int peer_cert_type; 1229 int peer_cert_type;
1230 1230
1231 CERT_PKEY *peer_key; /* points to an element of peer_pkeys (never NULL!) */ 1231 SSL_CERT_PKEY *peer_key; /* points to an element of peer_pkeys (never NULL!) */
1232 CERT_PKEY peer_pkeys[SSL_PKEY_NUM]; 1232 SSL_CERT_PKEY peer_pkeys[SSL_PKEY_NUM];
1233 /* Obviously we don't have the private keys of these, 1233 /* Obviously we don't have the private keys of these,
1234 * so maybe we shouldn't even use the CERT_PKEY type here. */ 1234 * so maybe we shouldn't even use the SSL_CERT_PKEY type here. */
1235 1235
1236 int references; /* actually always 1 at the moment */ 1236 int references; /* actually always 1 at the moment */
1237} SESS_CERT; 1237} SESS_CERT;
@@ -1293,13 +1293,13 @@ void ssl_info_callback(const SSL *s, int type, int value);
1293void ssl_msg_callback(SSL *s, int is_write, int content_type, 1293void ssl_msg_callback(SSL *s, int is_write, int content_type,
1294 const void *msg_buf, size_t msg_len); 1294 const void *msg_buf, size_t msg_len);
1295 1295
1296CERT *ssl_cert_new(void); 1296SSL_CERT *ssl_cert_new(void);
1297CERT *ssl_cert_dup(CERT *cert); 1297SSL_CERT *ssl_cert_dup(SSL_CERT *cert);
1298void ssl_cert_free(CERT *c); 1298void ssl_cert_free(SSL_CERT *c);
1299int ssl_cert_set0_chain(CERT *c, STACK_OF(X509) *chain); 1299int ssl_cert_set0_chain(SSL_CERT *c, STACK_OF(X509) *chain);
1300int ssl_cert_set1_chain(CERT *c, STACK_OF(X509) *chain); 1300int ssl_cert_set1_chain(SSL_CERT *c, STACK_OF(X509) *chain);
1301int ssl_cert_add0_chain_cert(CERT *c, X509 *cert); 1301int ssl_cert_add0_chain_cert(SSL_CERT *c, X509 *cert);
1302int ssl_cert_add1_chain_cert(CERT *c, X509 *cert); 1302int ssl_cert_add1_chain_cert(SSL_CERT *c, X509 *cert);
1303 1303
1304SESS_CERT *ssl_sess_cert_new(void); 1304SESS_CERT *ssl_sess_cert_new(void);
1305void ssl_sess_cert_free(SESS_CERT *sc); 1305void ssl_sess_cert_free(SESS_CERT *sc);
@@ -1328,12 +1328,12 @@ int ssl_verify_cert_chain(SSL *s, STACK_OF(X509) *sk);
1328int ssl_undefined_function(SSL *s); 1328int ssl_undefined_function(SSL *s);
1329int ssl_undefined_void_function(void); 1329int ssl_undefined_void_function(void);
1330int ssl_undefined_const_function(const SSL *s); 1330int ssl_undefined_const_function(const SSL *s);
1331CERT_PKEY *ssl_get_server_send_pkey(const SSL *s); 1331SSL_CERT_PKEY *ssl_get_server_send_pkey(const SSL *s);
1332EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *c, const EVP_MD **pmd, 1332EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *c, const EVP_MD **pmd,
1333 const struct ssl_sigalg **sap); 1333 const struct ssl_sigalg **sap);
1334size_t ssl_dhe_params_auto_key_bits(SSL *s); 1334size_t ssl_dhe_params_auto_key_bits(SSL *s);
1335int ssl_cert_type(X509 *x, EVP_PKEY *pkey); 1335int ssl_cert_type(X509 *x, EVP_PKEY *pkey);
1336void ssl_set_cert_masks(CERT *c, const SSL_CIPHER *cipher); 1336void ssl_set_cert_masks(SSL_CERT *c, const SSL_CIPHER *cipher);
1337STACK_OF(SSL_CIPHER) *ssl_get_ciphers_by_id(SSL *s); 1337STACK_OF(SSL_CIPHER) *ssl_get_ciphers_by_id(SSL *s);
1338int ssl_has_ecc_ciphers(SSL *s); 1338int ssl_has_ecc_ciphers(SSL *s);
1339int ssl_verify_alarm_type(long type); 1339int ssl_verify_alarm_type(long type);
@@ -1365,7 +1365,7 @@ void ssl_force_want_read(SSL *s);
1365int ssl3_dispatch_alert(SSL *s); 1365int ssl3_dispatch_alert(SSL *s);
1366int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek); 1366int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek);
1367int ssl3_write_bytes(SSL *s, int type, const void *buf, int len); 1367int ssl3_write_bytes(SSL *s, int type, const void *buf, int len);
1368int ssl3_output_cert_chain(SSL *s, CBB *cbb, CERT_PKEY *cpk); 1368int ssl3_output_cert_chain(SSL *s, CBB *cbb, SSL_CERT_PKEY *cpk);
1369SSL_CIPHER *ssl3_choose_cipher(SSL *ssl, STACK_OF(SSL_CIPHER) *clnt, 1369SSL_CIPHER *ssl3_choose_cipher(SSL *ssl, STACK_OF(SSL_CIPHER) *clnt,
1370 STACK_OF(SSL_CIPHER) *srvr); 1370 STACK_OF(SSL_CIPHER) *srvr);
1371int ssl3_setup_buffers(SSL *s); 1371int ssl3_setup_buffers(SSL *s);
diff --git a/src/lib/libssl/ssl_rsa.c b/src/lib/libssl/ssl_rsa.c
index e25b9387d7..6b1010e413 100644
--- a/src/lib/libssl/ssl_rsa.c
+++ b/src/lib/libssl/ssl_rsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_rsa.c,v 1.37 2021/11/29 18:36:27 tb Exp $ */ 1/* $OpenBSD: ssl_rsa.c,v 1.38 2022/01/08 12:43:44 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -66,11 +66,11 @@
66 66
67#include "ssl_locl.h" 67#include "ssl_locl.h"
68 68
69static int ssl_set_cert(CERT *c, X509 *x509); 69static int ssl_set_cert(SSL_CERT *c, X509 *x509);
70static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey); 70static int ssl_set_pkey(SSL_CERT *c, EVP_PKEY *pkey);
71static int use_certificate_chain_bio(BIO *in, CERT *cert, 71static int use_certificate_chain_bio(BIO *in, SSL_CERT *cert,
72 pem_password_cb *passwd_cb, void *passwd_arg); 72 pem_password_cb *passwd_cb, void *passwd_arg);
73static int use_certificate_chain_file(const char *file, CERT *cert, 73static int use_certificate_chain_file(const char *file, SSL_CERT *cert,
74 pem_password_cb *passwd_cb, void *passwd_arg); 74 pem_password_cb *passwd_cb, void *passwd_arg);
75 75
76int 76int
@@ -167,7 +167,7 @@ SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa)
167} 167}
168 168
169static int 169static int
170ssl_set_pkey(CERT *c, EVP_PKEY *pkey) 170ssl_set_pkey(SSL_CERT *c, EVP_PKEY *pkey)
171{ 171{
172 int i; 172 int i;
173 173
@@ -343,7 +343,7 @@ SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x)
343} 343}
344 344
345static int 345static int
346ssl_set_cert(CERT *c, X509 *x) 346ssl_set_cert(SSL_CERT *c, X509 *x)
347{ 347{
348 EVP_PKEY *pkey; 348 EVP_PKEY *pkey;
349 int i; 349 int i;
@@ -610,7 +610,7 @@ SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, const unsigned char *d,
610 * sent to the peer in the Certificate message. 610 * sent to the peer in the Certificate message.
611 */ 611 */
612static int 612static int
613use_certificate_chain_bio(BIO *in, CERT *cert, pem_password_cb *passwd_cb, 613use_certificate_chain_bio(BIO *in, SSL_CERT *cert, pem_password_cb *passwd_cb,
614 void *passwd_arg) 614 void *passwd_arg)
615{ 615{
616 X509 *ca, *x = NULL; 616 X509 *ca, *x = NULL;
@@ -653,7 +653,7 @@ use_certificate_chain_bio(BIO *in, CERT *cert, pem_password_cb *passwd_cb,
653} 653}
654 654
655int 655int
656use_certificate_chain_file(const char *file, CERT *cert, 656use_certificate_chain_file(const char *file, SSL_CERT *cert,
657 pem_password_cb *passwd_cb, void *passwd_arg) 657 pem_password_cb *passwd_cb, void *passwd_arg)
658{ 658{
659 BIO *in; 659 BIO *in;
diff --git a/src/lib/libssl/ssl_srvr.c b/src/lib/libssl/ssl_srvr.c
index 9fad66b91a..6e74943803 100644
--- a/src/lib/libssl/ssl_srvr.c
+++ b/src/lib/libssl/ssl_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_srvr.c,v 1.132 2022/01/07 16:45:06 jsing Exp $ */ 1/* $OpenBSD: ssl_srvr.c,v 1.133 2022/01/08 12:43:44 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -2277,7 +2277,7 @@ int
2277ssl3_send_server_certificate(SSL *s) 2277ssl3_send_server_certificate(SSL *s)
2278{ 2278{
2279 CBB cbb, server_cert; 2279 CBB cbb, server_cert;
2280 CERT_PKEY *cpk; 2280 SSL_CERT_PKEY *cpk;
2281 2281
2282 /* 2282 /*
2283 * Server Certificate - RFC 5246, section 7.4.2. 2283 * Server Certificate - RFC 5246, section 7.4.2.
diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c
index 78532054a0..be4bb3026c 100644
--- a/src/lib/libssl/t1_lib.c
+++ b/src/lib/libssl/t1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t1_lib.c,v 1.184 2021/11/26 16:41:42 tb Exp $ */ 1/* $OpenBSD: t1_lib.c,v 1.185 2022/01/08 12:43:44 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -569,7 +569,7 @@ tls1_check_ec_key(SSL *s, const uint16_t *curve_id, const uint8_t *comp_id)
569int 569int
570tls1_check_ec_server_key(SSL *s) 570tls1_check_ec_server_key(SSL *s)
571{ 571{
572 CERT_PKEY *cpk = s->cert->pkeys + SSL_PKEY_ECC; 572 SSL_CERT_PKEY *cpk = s->cert->pkeys + SSL_PKEY_ECC;
573 uint16_t curve_id; 573 uint16_t curve_id;
574 uint8_t comp_id; 574 uint8_t comp_id;
575 EC_KEY *eckey; 575 EC_KEY *eckey;
@@ -635,7 +635,7 @@ ssl_check_clienthello_tlsext_late(SSL *s)
635 if ((s->tlsext_status_type != -1) && 635 if ((s->tlsext_status_type != -1) &&
636 s->ctx && s->ctx->internal->tlsext_status_cb) { 636 s->ctx && s->ctx->internal->tlsext_status_cb) {
637 int r; 637 int r;
638 CERT_PKEY *certpkey; 638 SSL_CERT_PKEY *certpkey;
639 certpkey = ssl_get_server_send_pkey(s); 639 certpkey = ssl_get_server_send_pkey(s);
640 /* If no certificate can't return certificate status */ 640 /* If no certificate can't return certificate status */
641 if (certpkey == NULL) { 641 if (certpkey == NULL) {
diff --git a/src/lib/libssl/tls13_client.c b/src/lib/libssl/tls13_client.c
index 8ba78cd02b..882bce8c1f 100644
--- a/src/lib/libssl/tls13_client.c
+++ b/src/lib/libssl/tls13_client.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_client.c,v 1.89 2022/01/05 17:10:02 jsing Exp $ */ 1/* $OpenBSD: tls13_client.c,v 1.90 2022/01/08 12:43:44 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -828,7 +828,7 @@ tls13_server_finished_recv(struct tls13_ctx *ctx, CBS *cbs)
828} 828}
829 829
830static int 830static int
831tls13_client_check_certificate(struct tls13_ctx *ctx, CERT_PKEY *cpk, 831tls13_client_check_certificate(struct tls13_ctx *ctx, SSL_CERT_PKEY *cpk,
832 int *ok, const struct ssl_sigalg **out_sigalg) 832 int *ok, const struct ssl_sigalg **out_sigalg)
833{ 833{
834 const struct ssl_sigalg *sigalg; 834 const struct ssl_sigalg *sigalg;
@@ -851,12 +851,12 @@ tls13_client_check_certificate(struct tls13_ctx *ctx, CERT_PKEY *cpk,
851} 851}
852 852
853static int 853static int
854tls13_client_select_certificate(struct tls13_ctx *ctx, CERT_PKEY **out_cpk, 854tls13_client_select_certificate(struct tls13_ctx *ctx, SSL_CERT_PKEY **out_cpk,
855 const struct ssl_sigalg **out_sigalg) 855 const struct ssl_sigalg **out_sigalg)
856{ 856{
857 SSL *s = ctx->ssl; 857 SSL *s = ctx->ssl;
858 const struct ssl_sigalg *sigalg; 858 const struct ssl_sigalg *sigalg;
859 CERT_PKEY *cpk; 859 SSL_CERT_PKEY *cpk;
860 int cert_ok; 860 int cert_ok;
861 861
862 *out_cpk = NULL; 862 *out_cpk = NULL;
@@ -897,7 +897,7 @@ tls13_client_certificate_send(struct tls13_ctx *ctx, CBB *cbb)
897 CBB cert_request_context, cert_list; 897 CBB cert_request_context, cert_list;
898 const struct ssl_sigalg *sigalg; 898 const struct ssl_sigalg *sigalg;
899 STACK_OF(X509) *chain; 899 STACK_OF(X509) *chain;
900 CERT_PKEY *cpk; 900 SSL_CERT_PKEY *cpk;
901 X509 *cert; 901 X509 *cert;
902 int i, ret = 0; 902 int i, ret = 0;
903 903
@@ -948,7 +948,7 @@ tls13_client_certificate_verify_send(struct tls13_ctx *ctx, CBB *cbb)
948 EVP_MD_CTX *mdctx = NULL; 948 EVP_MD_CTX *mdctx = NULL;
949 EVP_PKEY_CTX *pctx; 949 EVP_PKEY_CTX *pctx;
950 EVP_PKEY *pkey; 950 EVP_PKEY *pkey;
951 const CERT_PKEY *cpk; 951 const SSL_CERT_PKEY *cpk;
952 CBB sig_cbb; 952 CBB sig_cbb;
953 int ret = 0; 953 int ret = 0;
954 954
diff --git a/src/lib/libssl/tls13_server.c b/src/lib/libssl/tls13_server.c
index c32ae22779..4edf3881c2 100644
--- a/src/lib/libssl/tls13_server.c
+++ b/src/lib/libssl/tls13_server.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_server.c,v 1.91 2022/01/07 15:46:30 jsing Exp $ */ 1/* $OpenBSD: tls13_server.c,v 1.92 2022/01/08 12:43:45 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2019, 2020 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2019, 2020 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2020 Bob Beck <beck@openbsd.org> 4 * Copyright (c) 2020 Bob Beck <beck@openbsd.org>
@@ -545,7 +545,7 @@ tls13_server_certificate_request_send(struct tls13_ctx *ctx, CBB *cbb)
545} 545}
546 546
547static int 547static int
548tls13_server_check_certificate(struct tls13_ctx *ctx, CERT_PKEY *cpk, 548tls13_server_check_certificate(struct tls13_ctx *ctx, SSL_CERT_PKEY *cpk,
549 int *ok, const struct ssl_sigalg **out_sigalg) 549 int *ok, const struct ssl_sigalg **out_sigalg)
550{ 550{
551 const struct ssl_sigalg *sigalg; 551 const struct ssl_sigalg *sigalg;
@@ -575,12 +575,12 @@ tls13_server_check_certificate(struct tls13_ctx *ctx, CERT_PKEY *cpk,
575} 575}
576 576
577static int 577static int
578tls13_server_select_certificate(struct tls13_ctx *ctx, CERT_PKEY **out_cpk, 578tls13_server_select_certificate(struct tls13_ctx *ctx, SSL_CERT_PKEY **out_cpk,
579 const struct ssl_sigalg **out_sigalg) 579 const struct ssl_sigalg **out_sigalg)
580{ 580{
581 SSL *s = ctx->ssl; 581 SSL *s = ctx->ssl;
582 const struct ssl_sigalg *sigalg; 582 const struct ssl_sigalg *sigalg;
583 CERT_PKEY *cpk; 583 SSL_CERT_PKEY *cpk;
584 int cert_ok; 584 int cert_ok;
585 585
586 *out_cpk = NULL; 586 *out_cpk = NULL;
@@ -616,7 +616,7 @@ tls13_server_certificate_send(struct tls13_ctx *ctx, CBB *cbb)
616 const struct ssl_sigalg *sigalg; 616 const struct ssl_sigalg *sigalg;
617 X509_STORE_CTX *xsc = NULL; 617 X509_STORE_CTX *xsc = NULL;
618 STACK_OF(X509) *chain; 618 STACK_OF(X509) *chain;
619 CERT_PKEY *cpk; 619 SSL_CERT_PKEY *cpk;
620 X509 *cert; 620 X509 *cert;
621 int i, ret = 0; 621 int i, ret = 0;
622 622
@@ -697,7 +697,7 @@ tls13_server_certificate_verify_send(struct tls13_ctx *ctx, CBB *cbb)
697 EVP_MD_CTX *mdctx = NULL; 697 EVP_MD_CTX *mdctx = NULL;
698 EVP_PKEY_CTX *pctx; 698 EVP_PKEY_CTX *pctx;
699 EVP_PKEY *pkey; 699 EVP_PKEY *pkey;
700 const CERT_PKEY *cpk; 700 const SSL_CERT_PKEY *cpk;
701 CBB sig_cbb; 701 CBB sig_cbb;
702 int ret = 0; 702 int ret = 0;
703 703