diff options
Diffstat (limited to 'src/lib/libtls/tls_conninfo.c')
-rw-r--r-- | src/lib/libtls/tls_conninfo.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/libtls/tls_conninfo.c b/src/lib/libtls/tls_conninfo.c index 685ed194e4..34535b5668 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.17 2018/02/08 10:02:48 jsing Exp $ */ | 1 | /* $OpenBSD: tls_conninfo.c,v 1.18 2018/02/10 04:41:24 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> |
@@ -221,6 +221,14 @@ tls_conninfo_cert_pem(struct tls *ctx) | |||
221 | return rv; | 221 | return rv; |
222 | } | 222 | } |
223 | 223 | ||
224 | static int | ||
225 | tls_conninfo_session(struct tls *ctx) | ||
226 | { | ||
227 | ctx->conninfo->session_resumed = SSL_session_reused(ctx->ssl_conn); | ||
228 | |||
229 | return 0; | ||
230 | } | ||
231 | |||
224 | int | 232 | int |
225 | tls_conninfo_populate(struct tls *ctx) | 233 | tls_conninfo_populate(struct tls *ctx) |
226 | { | 234 | { |
@@ -260,6 +268,9 @@ tls_conninfo_populate(struct tls *ctx) | |||
260 | if (tls_conninfo_cert_pem(ctx) == -1) | 268 | if (tls_conninfo_cert_pem(ctx) == -1) |
261 | goto err; | 269 | goto err; |
262 | 270 | ||
271 | if (tls_conninfo_session(ctx) == -1) | ||
272 | goto err; | ||
273 | |||
263 | return (0); | 274 | return (0); |
264 | 275 | ||
265 | err: | 276 | err: |
@@ -313,6 +324,14 @@ tls_conn_servername(struct tls *ctx) | |||
313 | return (ctx->conninfo->servername); | 324 | return (ctx->conninfo->servername); |
314 | } | 325 | } |
315 | 326 | ||
327 | int | ||
328 | tls_conn_session_resumed(struct tls *ctx) | ||
329 | { | ||
330 | if (ctx->conninfo == NULL) | ||
331 | return (0); | ||
332 | return (ctx->conninfo->session_resumed); | ||
333 | } | ||
334 | |||
316 | const char * | 335 | const char * |
317 | tls_conn_version(struct tls *ctx) | 336 | tls_conn_version(struct tls *ctx) |
318 | { | 337 | { |