diff options
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
| -rw-r--r-- | src/lib/libssl/ssl_lib.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 64b1806238..fb0920cdf2 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.282 2022/01/08 12:43:44 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.283 2022/01/08 12:59:58 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 | * |
| @@ -883,20 +883,14 @@ SSL_get_peer_certificate(const SSL *s) | |||
| 883 | STACK_OF(X509) * | 883 | STACK_OF(X509) * |
| 884 | SSL_get_peer_cert_chain(const SSL *s) | 884 | SSL_get_peer_cert_chain(const SSL *s) |
| 885 | { | 885 | { |
| 886 | STACK_OF(X509) *r; | 886 | if (s == NULL || s->session == NULL) |
| 887 | 887 | return NULL; | |
| 888 | if ((s == NULL) || (s->session == NULL) || | ||
| 889 | (s->session->sess_cert == NULL)) | ||
| 890 | r = NULL; | ||
| 891 | else | ||
| 892 | r = s->session->sess_cert->cert_chain; | ||
| 893 | 888 | ||
| 894 | /* | 889 | /* |
| 895 | * If we are a client, cert_chain includes the peer's own | 890 | * If we are a client, cert_chain includes the peer's own |
| 896 | * certificate; | 891 | * certificate; if we are a server, it does not. |
| 897 | * if we are a server, it does not. | ||
| 898 | */ | 892 | */ |
| 899 | return (r); | 893 | return s->session->cert_chain; |
| 900 | } | 894 | } |
| 901 | 895 | ||
| 902 | STACK_OF(X509) * | 896 | STACK_OF(X509) * |
