doh: fix leak and zero-length HTTPS RR crash

This PR fixes a leak and a crash that can happen when curl encounters
bad HTTPS RR values in DNS. We're starting to do better testing of that
kind of thing and e.g. have published bad HTTPS RR values at
dodgy.test.defo.ie.

Closes #14151
This commit is contained in:
Stephen Farrell 2024-07-10 23:43:32 +01:00 committed by Daniel Stenberg
parent 91530abc1e
commit 6a5bb68556
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 21 additions and 8 deletions

View file

@ -68,7 +68,8 @@ declare -A ech_targets=(
[draft-13.esni.defo.ie:12414]=""
[crypto.cloudflare.com]="cdn-cgi/trace"
[tls-ech.dev]=""
[epochbelt.com]=""
# this one's gone away for now (possibly temporarily)
# [epochbelt.com]=""
)
# Targets we expect not to be ECH-enabled servers
@ -102,7 +103,7 @@ declare -A neither_targets=(
: "${tout:=10s}"
# Where we find OpenSSL .so's
: "${OSSL:=$HOME/code/openssl}"
: "${OSSL:=$HOME/code/openssl-local-inst}"
# Where we find WolfSSL .so's
: "${WSSL:=$HOME/code/wolfssl/inst/lib}"
@ -412,6 +413,11 @@ then
echo "Skipping $targ as ports != 443 seem blocked"
continue
fi
if [[ "$host" == "crypto.cloudflare.com" ]]
then
echo "Skipping $host as they've blocked PN override"
continue
fi
path=${ech_targets[$targ]}
turl="https://$host:$port/$path"
echo "PN override check for $turl"