diff options
author | tb <> | 2022-06-03 13:26:13 +0000 |
---|---|---|
committer | tb <> | 2022-06-03 13:26:13 +0000 |
commit | b728d34dfe365276750c682a222b07f9c1ae13c2 (patch) | |
tree | 69f0c26cddd363da007e5c143ad5b5cbb78e726f | |
parent | 8703009df29b1a5d1c70f4993dbec5e0009b467a (diff) | |
download | openbsd-b728d34dfe365276750c682a222b07f9c1ae13c2.tar.gz openbsd-b728d34dfe365276750c682a222b07f9c1ae13c2.tar.bz2 openbsd-b728d34dfe365276750c682a222b07f9c1ae13c2.zip |
Ensure that a client who sent a PSK extension has also sent a PSK
key exchange mode extension, as required by RFC 8446, 4.2.9.
ok jsing
-rw-r--r-- | src/lib/libssl/tls13_server.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/libssl/tls13_server.c b/src/lib/libssl/tls13_server.c index 4ac84a808c..815c394737 100644 --- a/src/lib/libssl/tls13_server.c +++ b/src/lib/libssl/tls13_server.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_server.c,v 1.96 2022/02/03 16:33:12 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_server.c,v 1.97 2022/06/03 13:26:13 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2019, 2020 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2019, 2020 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2020 Bob Beck <beck@openbsd.org> | 4 | * Copyright (c) 2020 Bob Beck <beck@openbsd.org> |
@@ -108,10 +108,15 @@ tls13_client_hello_required_extensions(struct tls13_ctx *ctx) | |||
108 | */ | 108 | */ |
109 | 109 | ||
110 | /* | 110 | /* |
111 | * If we got no pre_shared_key, then signature_algorithms and | 111 | * RFC 8446, 4.2.9: if we got a pre_shared_key, then we also need |
112 | * supported_groups must both be present. | 112 | * psk_key_exchange_modes. Otherwise, section 9.2 specifies that we |
113 | * need both signature_algorithms and supported_groups. | ||
113 | */ | 114 | */ |
114 | if (!tlsext_extension_seen(s, TLSEXT_TYPE_pre_shared_key)) { | 115 | if (tlsext_extension_seen(s, TLSEXT_TYPE_pre_shared_key)) { |
116 | if (!tlsext_extension_seen(s, | ||
117 | TLSEXT_TYPE_psk_key_exchange_modes)) | ||
118 | return 0; | ||
119 | } else { | ||
115 | if (!tlsext_extension_seen(s, TLSEXT_TYPE_signature_algorithms)) | 120 | if (!tlsext_extension_seen(s, TLSEXT_TYPE_signature_algorithms)) |
116 | return 0; | 121 | return 0; |
117 | if (!tlsext_extension_seen(s, TLSEXT_TYPE_supported_groups)) | 122 | if (!tlsext_extension_seen(s, TLSEXT_TYPE_supported_groups)) |