diff options
author | tb <> | 2024-08-02 15:00:01 +0000 |
---|---|---|
committer | tb <> | 2024-08-02 15:00:01 +0000 |
commit | b406bf2119594dc725dd7e537eb049151f94db87 (patch) | |
tree | 61d7fc5b40064d7fad6956a89b7a64bd8e33c1a9 /src/lib/libtls/tls.h | |
parent | 3f8ee49b42e8a18a7e21ac4d0b5091931372b9a0 (diff) | |
download | openbsd-b406bf2119594dc725dd7e537eb049151f94db87.tar.gz openbsd-b406bf2119594dc725dd7e537eb049151f94db87.tar.bz2 openbsd-b406bf2119594dc725dd7e537eb049151f94db87.zip |
libtls: fix legacy protocol parsing
Redefining TLS_PROTOCOL_TLSv1_0 and TLS_PROTOCOL_TLSv1_1 to be the same
as TLS_PROTOCOL_TLSv1_2 had undesired side effects, as witnessed in the
accompanying regress tests. The protocol string all:tlsv1.0 would disable
TLSv1.2 (so only enable TLSv1.3) and tlsv1.2:!tlsv1.1 would disable all
protocols.
It makes more sense to ignore any setting of TLSv1.0 and TLSv1.1, so if
you request 'tlsv1.1' you get no protocol, but 'all:!tlsv1.1' will enable
the two supported protocols TLSv1.3 and TLSv1.2.
Restore the defines to their original values and adjust the parsing code
to set/unset them.
Issue reported by Kenjiro Nakayama
Fixes https://github.com/libressl/openbsd/issues/151
with/ok jsing
Diffstat (limited to 'src/lib/libtls/tls.h')
-rw-r--r-- | src/lib/libtls/tls.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libtls/tls.h b/src/lib/libtls/tls.h index 67804d7cd8..6b36886dc3 100644 --- a/src/lib/libtls/tls.h +++ b/src/lib/libtls/tls.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls.h,v 1.66 2024/03/27 07:35:30 joshua Exp $ */ | 1 | /* $OpenBSD: tls.h,v 1.67 2024/08/02 15:00:01 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -33,8 +33,8 @@ extern "C" { | |||
33 | * Deprecated versions of TLS. Using these effectively selects | 33 | * Deprecated versions of TLS. Using these effectively selects |
34 | * the minimum supported version. | 34 | * the minimum supported version. |
35 | */ | 35 | */ |
36 | #define TLS_PROTOCOL_TLSv1_0 (1 << 3) | 36 | #define TLS_PROTOCOL_TLSv1_0 (1 << 1) |
37 | #define TLS_PROTOCOL_TLSv1_1 (1 << 3) | 37 | #define TLS_PROTOCOL_TLSv1_1 (1 << 2) |
38 | /* Supported versions of TLS */ | 38 | /* Supported versions of TLS */ |
39 | #define TLS_PROTOCOL_TLSv1_2 (1 << 3) | 39 | #define TLS_PROTOCOL_TLSv1_2 (1 << 3) |
40 | #define TLS_PROTOCOL_TLSv1_3 (1 << 4) | 40 | #define TLS_PROTOCOL_TLSv1_3 (1 << 4) |