diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libtls/tls_conninfo.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/libtls/tls_conninfo.c b/src/lib/libtls/tls_conninfo.c index 523b2798d3..281af79866 100644 --- a/src/lib/libtls/tls_conninfo.c +++ b/src/lib/libtls/tls_conninfo.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls_conninfo.c,v 1.9 2016/08/15 14:47:41 jsing Exp $ */ | 1 | /* $OpenBSD: tls_conninfo.c,v 1.10 2016/08/22 14:55:59 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> |
| @@ -199,6 +199,11 @@ tls_get_conninfo(struct tls *ctx) | |||
| 199 | goto err; | 199 | goto err; |
| 200 | if (tls_conninfo_alpn_proto(ctx) == -1) | 200 | if (tls_conninfo_alpn_proto(ctx) == -1) |
| 201 | goto err; | 201 | goto err; |
| 202 | if (ctx->servername != NULL) { | ||
| 203 | if ((ctx->conninfo->servername = | ||
| 204 | strdup(ctx->servername)) == NULL) | ||
| 205 | goto err; | ||
| 206 | } | ||
| 202 | 207 | ||
| 203 | return (0); | 208 | return (0); |
| 204 | err: | 209 | err: |
| @@ -242,6 +247,14 @@ tls_conn_cipher(struct tls *ctx) | |||
| 242 | } | 247 | } |
| 243 | 248 | ||
| 244 | const char * | 249 | const char * |
| 250 | tls_conn_servername(struct tls *ctx) | ||
| 251 | { | ||
| 252 | if (ctx->conninfo == NULL) | ||
| 253 | return (NULL); | ||
| 254 | return (ctx->conninfo->servername); | ||
| 255 | } | ||
| 256 | |||
| 257 | const char * | ||
| 245 | tls_conn_version(struct tls *ctx) | 258 | tls_conn_version(struct tls *ctx) |
| 246 | { | 259 | { |
| 247 | if (ctx->conninfo == NULL) | 260 | if (ctx->conninfo == NULL) |
