1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Issue 1447: Pass proper Host header and SNI when SRV is used with curl.

* configure.ac: Check for inet_ntop.

* m4/libcurl.m4: Provide a #define for the version of the curl
  library.

* keyserver/gpgkeys_hkp.c (main, srv_replace): Call getaddrinfo() on
  each target.  Once we find one that resolves to an address (whether
  IPv4 or IPv6), pass it into libcurl via CURLOPT_RESOLVE using the
  SRV name as the "host".  Force the HTTP Host header to be the same.

Backported from 6b1f71055e

* keyserver/gpgkeys_hkp.c (main): Only default try-dns-srv to on if we
  have SRV support in the first place.

Backported from 732f3d1d47
This commit is contained in:
David Shaw 2012-12-19 13:54:27 -05:00
parent 6c3a76cca0
commit 5c557a51cd
3 changed files with 132 additions and 35 deletions

View file

@ -66,6 +66,11 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
_libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'"
# More recent versions of curl-config have a direct --vernum
# option, but we'd like this code to work with older versions as
# well, so just convert --version.
_libcurl_vernum_parse="eval $AWK '{printf \"0x%06X\",\$NF}'"
_libcurl_try_link=yes
if test -d "$_libcurl_with" ; then
@ -206,6 +211,10 @@ x=CURLOPT_VERBOSE;
AC_SUBST(LIBCURL_CPPFLAGS)
AC_SUBST(LIBCURL)
_libcurl_vernum=`echo $_libcurl_version | $_libcurl_vernum_parse`
AC_DEFINE_UNQUOTED(LIBCURL_VERNUM,$_libcurl_vernum,[The version of the libcurl library in packed hex form])
for _libcurl_feature in $_libcurl_features ; do
AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1])
eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes
@ -246,6 +255,7 @@ x=CURLOPT_VERBOSE;
unset _libcurl_protocol
unset _libcurl_protocols
unset _libcurl_version
unset _libcurl_vernum
unset _libcurl_ldflags
fi