diff options
author | jsing <> | 2022-08-17 07:39:19 +0000 |
---|---|---|
committer | jsing <> | 2022-08-17 07:39:19 +0000 |
commit | b0c5f651476e9397892adf645bba468df03d0ea9 (patch) | |
tree | d4b208572f46a7c773aecb3e2d410aeaae5e817a /src/lib/libssl/ssl_locl.h | |
parent | 7e9e21e27683a4be2c58fedde7fc9303f63a83f9 (diff) | |
download | openbsd-b0c5f651476e9397892adf645bba468df03d0ea9.tar.gz openbsd-b0c5f651476e9397892adf645bba468df03d0ea9.tar.bz2 openbsd-b0c5f651476e9397892adf645bba468df03d0ea9.zip |
Deduplicate peer certificate chain processing code.
Rather than reimplement this in each TLS client and server, deduplicate it
into a single function. Furthermore, rather than dealing with the API
hazard that is SSL_get_peer_cert_chain() in this code, simply produce two
chains - one that has the leaf and one that does not.
SSL_get_peer_cert_chain() can then return the appropriate one.
This also moves the peer cert chain from the SSL_SESSION to the
SSL_HANDSHAKE, which makes more sense since it is not available on
resumption.
ok tb@
Diffstat (limited to 'src/lib/libssl/ssl_locl.h')
-rw-r--r-- | src/lib/libssl/ssl_locl.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index 18daf791f0..1bfeeb9740 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.417 2022/07/24 14:28:16 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_locl.h,v 1.418 2022/08/17 07:39:19 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 | * |
@@ -518,8 +518,6 @@ struct ssl_session_st { | |||
518 | * not_resumable_session_cb to disable session caching and tickets. */ | 518 | * not_resumable_session_cb to disable session caching and tickets. */ |
519 | int not_resumable; | 519 | int not_resumable; |
520 | 520 | ||
521 | STACK_OF(X509) *cert_chain; /* as received from peer */ | ||
522 | |||
523 | size_t tlsext_ecpointformatlist_length; | 521 | size_t tlsext_ecpointformatlist_length; |
524 | uint8_t *tlsext_ecpointformatlist; /* peer's list */ | 522 | uint8_t *tlsext_ecpointformatlist; /* peer's list */ |
525 | size_t tlsext_supportedgroups_length; | 523 | size_t tlsext_supportedgroups_length; |
@@ -645,6 +643,10 @@ typedef struct ssl_handshake_st { | |||
645 | uint8_t peer_finished[EVP_MAX_MD_SIZE]; | 643 | uint8_t peer_finished[EVP_MAX_MD_SIZE]; |
646 | size_t peer_finished_len; | 644 | size_t peer_finished_len; |
647 | 645 | ||
646 | /* List of certificates received from our peer. */ | ||
647 | STACK_OF(X509) *peer_certs; | ||
648 | STACK_OF(X509) *peer_certs_no_leaf; | ||
649 | |||
648 | SSL_HANDSHAKE_TLS12 tls12; | 650 | SSL_HANDSHAKE_TLS12 tls12; |
649 | SSL_HANDSHAKE_TLS13 tls13; | 651 | SSL_HANDSHAKE_TLS13 tls13; |
650 | } SSL_HANDSHAKE; | 652 | } SSL_HANDSHAKE; |
@@ -1566,6 +1568,8 @@ int srtp_find_profile_by_num(unsigned int profile_num, | |||
1566 | 1568 | ||
1567 | #endif /* OPENSSL_NO_SRTP */ | 1569 | #endif /* OPENSSL_NO_SRTP */ |
1568 | 1570 | ||
1571 | int tls_process_peer_certs(SSL *s, STACK_OF(X509) *peer_certs); | ||
1572 | |||
1569 | __END_HIDDEN_DECLS | 1573 | __END_HIDDEN_DECLS |
1570 | 1574 | ||
1571 | #endif | 1575 | #endif |