summaryrefslogtreecommitdiff
path: root/lib/libssl
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2022-01-11 18:43:01 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2022-01-11 18:43:01 +0000
commitc268aa9fff0ca8dcb406af5643898cec259a3108 (patch)
treeaeecba2cf2b7903e72150a31e18c29c61f9e6646 /lib/libssl
parent766b0eed1c19266cb8da25d8aeb813107014aa15 (diff)
Simplify SSL_get_peer_certificate()
ok inoguchi@ tb@
Diffstat (limited to 'lib/libssl')
-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) *