summaryrefslogtreecommitdiff
path: root/lib/libtls/tls.c
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2015-10-07 23:25:46 +0000
committerBob Beck <beck@cvs.openbsd.org>2015-10-07 23:25:46 +0000
commit36cbf12ad3fea2d875a1c3d83cfbcf4fad113667 (patch)
treeca4f9771dc8d275ca43f0c574bbe2e60246003ab /lib/libtls/tls.c
parent2a9b76132894f734d31edb1f3e036a11e4b5abae (diff)
Allow us to get cipher and version even if there is not a peer certificate.
ok doug@
Diffstat (limited to 'lib/libtls/tls.c')
-rw-r--r--lib/libtls/tls.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libtls/tls.c b/lib/libtls/tls.c
index f8412717544..0a7c9583699 100644
--- a/lib/libtls/tls.c
+++ b/lib/libtls/tls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls.c,v 1.33 2015/09/29 10:17:04 deraadt Exp $ */
+/* $OpenBSD: tls.c,v 1.34 2015/10/07 23:25:45 beck Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -400,10 +400,11 @@ tls_handshake(struct tls *ctx)
else if ((ctx->flags & TLS_SERVER_CONN) != 0)
rv = tls_handshake_server(ctx);
- if (rv == 0 &&
- (ctx->ssl_peer_cert = SSL_get_peer_certificate(ctx->ssl_conn)) &&
- (tls_get_conninfo(ctx) == -1))
- rv = -1;
+ if (rv == 0) {
+ ctx->ssl_peer_cert = SSL_get_peer_certificate(ctx->ssl_conn);
+ if (tls_get_conninfo(ctx) == -1)
+ rv = -1;
+ }
out:
/* Prevent callers from performing incorrect error handling */
errno = 0;