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.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/libtls/tls_peer.c b/src/lib/libtls/tls_peer.c
index 802a9c2780..1a9065dfb1 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.6 2016/08/22 17:08:10 jsing Exp $ */ 1/* $OpenBSD: tls_peer.c,v 1.7 2017/04/05 03:19:22 beck 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>
@@ -81,3 +81,14 @@ tls_peer_cert_notafter(struct tls *ctx)
81 return (ctx->conninfo->notafter); 81 return (ctx->conninfo->notafter);
82} 82}
83 83
84const uint8_t *
85tls_peer_cert_chain_pem(struct tls *ctx, size_t *size)
86{
87 if (ctx->ssl_peer_cert == NULL)
88 return (NULL);
89 if (ctx->conninfo == NULL)
90 return (NULL);
91 *size = ctx->conninfo->peer_cert_len;
92 return (ctx->conninfo->peer_cert);
93}
94