summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2020-11-16 18:55:15 +0000
committerjsing <jsing@openbsd.org>2020-11-16 18:55:15 +0000
commit607bf31452c63b312701c91e417c4d2b8e14ba0c (patch)
tree27d40968907ad9fec7249e33b14c80c3b07ffee1 /lib/libssl/ssl_lib.c
parentPrevent exit status from being clobbered on thread exit. (diff)
downloadwireguard-openbsd-607bf31452c63b312701c91e417c4d2b8e14ba0c.tar.xz
wireguard-openbsd-607bf31452c63b312701c91e417c4d2b8e14ba0c.zip
Implement exporter for TLSv1.3.
This implements the key material exporter for TLSv1.3, as defined in RFC8446 section 7.5. Issue reported by nmathewson on github. ok inoguchi@ tb@
Diffstat (limited to 'lib/libssl/ssl_lib.c')
-rw-r--r--lib/libssl/ssl_lib.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index d92ccd80291..58b9dae9102 100644
--- a/lib/libssl/ssl_lib.c
+++ b/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_lib.c,v 1.237 2020/10/14 16:57:33 jsing Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.238 2020/11/16 18:55:15 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1716,8 +1716,17 @@ SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
const char *label, size_t llen, const unsigned char *p, size_t plen,
int use_context)
{
- return (tls1_export_keying_material(s, out, olen,
- label, llen, p, plen, use_context));
+ if (s->internal->tls13 != NULL && s->version == TLS1_3_VERSION) {
+ if (!use_context) {
+ p = NULL;
+ plen = 0;
+ }
+ return tls13_exporter(s->internal->tls13, label, llen, p, plen,
+ out, olen);
+ }
+
+ return (tls1_export_keying_material(s, out, olen, label, llen, p, plen,
+ use_context));
}
static unsigned long