summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libssl/ssl_lib.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index a90490ff55b..c66437e77db 100644
--- a/lib/libssl/ssl_lib.c
+++ b/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_lib.c,v 1.285 2022/01/11 18:39:28 jsing Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.286 2022/01/11 18:43:00 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -865,19 +865,17 @@ SSL_pending(const SSL *s)
X509 *
SSL_get_peer_certificate(const SSL *s)
{
- X509 *r;
+ X509 *cert;
- if ((s == NULL) || (s->session == NULL))
- r = NULL;
- else
- r = s->session->peer_cert;
+ if (s == NULL || s->session == NULL)
+ return NULL;
- if (r == NULL)
- return (r);
+ if ((cert = s->session->peer_cert) == NULL)
+ return NULL;
- X509_up_ref(r);
+ X509_up_ref(cert);
- return (r);
+ return cert;
}
STACK_OF(X509) *