diff options
author | jsing <> | 2020-11-16 18:55:15 +0000 |
---|---|---|
committer | jsing <> | 2020-11-16 18:55:15 +0000 |
commit | 7edbb85fb63bc248e3633a6d70bd4e49c811e451 (patch) | |
tree | 23027db55bc9d45c4690d13e3be7302ff83c4055 /src/lib/libssl/ssl_lib.c | |
parent | abffca736d5ed1aaca940a97ae97979bc46699f8 (diff) | |
download | openbsd-7edbb85fb63bc248e3633a6d70bd4e49c811e451.tar.gz openbsd-7edbb85fb63bc248e3633a6d70bd4e49c811e451.tar.bz2 openbsd-7edbb85fb63bc248e3633a6d70bd4e49c811e451.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 'src/lib/libssl/ssl_lib.c')
-rw-r--r-- | src/lib/libssl/ssl_lib.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index d92ccd8029..58b9dae910 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_lib.c,v 1.237 2020/10/14 16:57:33 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.238 2020/11/16 18:55:15 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -1716,8 +1716,17 @@ SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, | |||
1716 | const char *label, size_t llen, const unsigned char *p, size_t plen, | 1716 | const char *label, size_t llen, const unsigned char *p, size_t plen, |
1717 | int use_context) | 1717 | int use_context) |
1718 | { | 1718 | { |
1719 | return (tls1_export_keying_material(s, out, olen, | 1719 | if (s->internal->tls13 != NULL && s->version == TLS1_3_VERSION) { |
1720 | label, llen, p, plen, use_context)); | 1720 | if (!use_context) { |
1721 | p = NULL; | ||
1722 | plen = 0; | ||
1723 | } | ||
1724 | return tls13_exporter(s->internal->tls13, label, llen, p, plen, | ||
1725 | out, olen); | ||
1726 | } | ||
1727 | |||
1728 | return (tls1_export_keying_material(s, out, olen, label, llen, p, plen, | ||
1729 | use_context)); | ||
1721 | } | 1730 | } |
1722 | 1731 | ||
1723 | static unsigned long | 1732 | static unsigned long |