diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libtls/Symbols.list | 1 | ||||
-rw-r--r-- | src/lib/libtls/tls.h | 3 | ||||
-rw-r--r-- | src/lib/libtls/tls_conninfo.c | 11 | ||||
-rw-r--r-- | src/lib/libtls/tls_internal.h | 3 |
4 files changed, 15 insertions, 3 deletions
diff --git a/src/lib/libtls/Symbols.list b/src/lib/libtls/Symbols.list index 4064be1b08..e3fcb67fb3 100644 --- a/src/lib/libtls/Symbols.list +++ b/src/lib/libtls/Symbols.list | |||
@@ -51,6 +51,7 @@ tls_config_verify_client_optional | |||
51 | tls_configure | 51 | tls_configure |
52 | tls_conn_alpn_selected | 52 | tls_conn_alpn_selected |
53 | tls_conn_cipher | 53 | tls_conn_cipher |
54 | tls_conn_cipher_strength | ||
54 | tls_conn_servername | 55 | tls_conn_servername |
55 | tls_conn_session_resumed | 56 | tls_conn_session_resumed |
56 | tls_conn_version | 57 | tls_conn_version |
diff --git a/src/lib/libtls/tls.h b/src/lib/libtls/tls.h index 560809ee19..fee60c7cc8 100644 --- a/src/lib/libtls/tls.h +++ b/src/lib/libtls/tls.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls.h,v 1.55 2018/11/29 14:24:23 tedu Exp $ */ | 1 | /* $OpenBSD: tls.h,v 1.56 2019/11/02 13:37:59 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -190,6 +190,7 @@ const uint8_t *tls_peer_cert_chain_pem(struct tls *_ctx, size_t *_len); | |||
190 | 190 | ||
191 | const char *tls_conn_alpn_selected(struct tls *_ctx); | 191 | const char *tls_conn_alpn_selected(struct tls *_ctx); |
192 | const char *tls_conn_cipher(struct tls *_ctx); | 192 | const char *tls_conn_cipher(struct tls *_ctx); |
193 | int tls_conn_cipher_strength(struct tls *_ctx); | ||
193 | const char *tls_conn_servername(struct tls *_ctx); | 194 | const char *tls_conn_servername(struct tls *_ctx); |
194 | int tls_conn_session_resumed(struct tls *_ctx); | 195 | int tls_conn_session_resumed(struct tls *_ctx); |
195 | const char *tls_conn_version(struct tls *_ctx); | 196 | const char *tls_conn_version(struct tls *_ctx); |
diff --git a/src/lib/libtls/tls_conninfo.c b/src/lib/libtls/tls_conninfo.c index 8e479ed84c..d44dc842b6 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.20 2018/02/10 04:48:44 jsing Exp $ */ | 1 | /* $OpenBSD: tls_conninfo.c,v 1.21 2019/11/02 13:37: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> |
@@ -246,6 +246,7 @@ tls_conninfo_populate(struct tls *ctx) | |||
246 | goto err; | 246 | goto err; |
247 | if ((ctx->conninfo->cipher = strdup(tmp)) == NULL) | 247 | if ((ctx->conninfo->cipher = strdup(tmp)) == NULL) |
248 | goto err; | 248 | goto err; |
249 | ctx->conninfo->cipher_strength = SSL_get_cipher_bits(ctx->ssl_conn, NULL); | ||
249 | 250 | ||
250 | if (ctx->servername != NULL) { | 251 | if (ctx->servername != NULL) { |
251 | if ((ctx->conninfo->servername = | 252 | if ((ctx->conninfo->servername = |
@@ -312,6 +313,14 @@ tls_conn_cipher(struct tls *ctx) | |||
312 | return (ctx->conninfo->cipher); | 313 | return (ctx->conninfo->cipher); |
313 | } | 314 | } |
314 | 315 | ||
316 | int | ||
317 | tls_conn_cipher_strength(struct tls *ctx) | ||
318 | { | ||
319 | if (ctx->conninfo == NULL) | ||
320 | return (0); | ||
321 | return (ctx->conninfo->cipher_strength); | ||
322 | } | ||
323 | |||
315 | const char * | 324 | const char * |
316 | tls_conn_servername(struct tls *ctx) | 325 | tls_conn_servername(struct tls *ctx) |
317 | { | 326 | { |
diff --git a/src/lib/libtls/tls_internal.h b/src/lib/libtls/tls_internal.h index 3842439d58..efccc9fdbe 100644 --- a/src/lib/libtls/tls_internal.h +++ b/src/lib/libtls/tls_internal.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_internal.h,v 1.74 2019/04/01 15:58:02 jsing Exp $ */ | 1 | /* $OpenBSD: tls_internal.h,v 1.75 2019/11/02 13:37:59 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> | 3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> |
4 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 4 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
@@ -112,6 +112,7 @@ struct tls_config { | |||
112 | struct tls_conninfo { | 112 | struct tls_conninfo { |
113 | char *alpn; | 113 | char *alpn; |
114 | char *cipher; | 114 | char *cipher; |
115 | int cipher_strength; | ||
115 | char *servername; | 116 | char *servername; |
116 | int session_resumed; | 117 | int session_resumed; |
117 | char *version; | 118 | char *version; |