summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls_peer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libtls/tls_peer.c')
-rw-r--r--src/lib/libtls/tls_peer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/libtls/tls_peer.c b/src/lib/libtls/tls_peer.c
index 1a9065dfb1..ec97a30838 100644
--- a/src/lib/libtls/tls_peer.c
+++ b/src/lib/libtls/tls_peer.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_peer.c,v 1.7 2017/04/05 03:19:22 beck Exp $ */ 1/* $OpenBSD: tls_peer.c,v 1.8 2017/04/10 17:11:13 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2015 Bob Beck <beck@openbsd.org> 4 * Copyright (c) 2015 Bob Beck <beck@openbsd.org>
@@ -55,10 +55,15 @@ tls_peer_cert_provided(struct tls *ctx)
55int 55int
56tls_peer_cert_contains_name(struct tls *ctx, const char *name) 56tls_peer_cert_contains_name(struct tls *ctx, const char *name)
57{ 57{
58 int match;
59
58 if (ctx->ssl_peer_cert == NULL) 60 if (ctx->ssl_peer_cert == NULL)
59 return (0); 61 return (0);
60 62
61 return (tls_check_name(ctx, ctx->ssl_peer_cert, name) == 0); 63 if (tls_check_name(ctx, ctx->ssl_peer_cert, name, &match) == -1)
64 return (0);
65
66 return (match);
62} 67}
63 68
64time_t 69time_t