diff options
author | tb <> | 2022-01-24 13:49:50 +0000 |
---|---|---|
committer | tb <> | 2022-01-24 13:49:50 +0000 |
commit | 12a5d609ed535ca507ce00217fff3cc8f67f9e5c (patch) | |
tree | c3b4b67dcc7a47346bcf780fdc92a1429e2e9c10 /src | |
parent | 4153a7cb53c79cd7fd5f797c80d90f28d6d482de (diff) | |
download | openbsd-12a5d609ed535ca507ce00217fff3cc8f67f9e5c.tar.gz openbsd-12a5d609ed535ca507ce00217fff3cc8f67f9e5c.tar.bz2 openbsd-12a5d609ed535ca507ce00217fff3cc8f67f9e5c.zip |
Avoid use of uninitialized in tlsext_sni_server_parse()
If the hostname is too long, tlsext_sni_is_valid_hostname() will fail
without having initialized *is_ip. As a result, the garbage value could
lead to accepting (but otherwise ignoring) overlong and possibly invalid
hostnames without erroring in tlsext_sni_server_parse().
ok inoguchi jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/ssl_tlsext.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libssl/ssl_tlsext.c b/src/lib/libssl/ssl_tlsext.c index 69f8ddbc40..8070296d9f 100644 --- a/src/lib/libssl/ssl_tlsext.c +++ b/src/lib/libssl/ssl_tlsext.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_tlsext.c,v 1.108 2022/01/11 18:28:41 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_tlsext.c,v 1.109 2022/01/24 13:49:50 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> | 4 | * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> |
@@ -714,6 +714,8 @@ tlsext_sni_is_valid_hostname(CBS *cbs, int *is_ip) | |||
714 | int component = 0; | 714 | int component = 0; |
715 | CBS hostname; | 715 | CBS hostname; |
716 | 716 | ||
717 | *is_ip = 0; | ||
718 | |||
717 | CBS_dup(cbs, &hostname); | 719 | CBS_dup(cbs, &hostname); |
718 | 720 | ||
719 | if (CBS_len(&hostname) > TLSEXT_MAXLEN_host_name) | 721 | if (CBS_len(&hostname) > TLSEXT_MAXLEN_host_name) |