diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libssl/ssl_lib.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index a90490ff55..c66437e77d 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.285 2022/01/11 18:39:28 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.286 2022/01/11 18:43:00 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 | * |
| @@ -865,19 +865,17 @@ SSL_pending(const SSL *s) | |||
| 865 | X509 * | 865 | X509 * |
| 866 | SSL_get_peer_certificate(const SSL *s) | 866 | SSL_get_peer_certificate(const SSL *s) |
| 867 | { | 867 | { |
| 868 | X509 *r; | 868 | X509 *cert; |
| 869 | 869 | ||
| 870 | if ((s == NULL) || (s->session == NULL)) | 870 | if (s == NULL || s->session == NULL) |
| 871 | r = NULL; | 871 | return NULL; |
| 872 | else | ||
| 873 | r = s->session->peer_cert; | ||
| 874 | 872 | ||
| 875 | if (r == NULL) | 873 | if ((cert = s->session->peer_cert) == NULL) |
| 876 | return (r); | 874 | return NULL; |
| 877 | 875 | ||
| 878 | X509_up_ref(r); | 876 | X509_up_ref(cert); |
| 879 | 877 | ||
| 880 | return (r); | 878 | return cert; |
| 881 | } | 879 | } |
| 882 | 880 | ||
| 883 | STACK_OF(X509) * | 881 | STACK_OF(X509) * |
