diff options
author | Justus Winter <[email protected]> | 2017-06-20 14:27:59 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2017-06-20 14:38:54 +0000 |
commit | 48aae8167dcae80d43b08167a88d9eb170781a04 (patch) | |
tree | 0b3dd748a3ef73805d6c75db65b3055c021c5cda /common/sysutils.h | |
parent | dirmngr: Refactor variable-sized array code. (diff) | |
download | gnupg-48aae8167dcae80d43b08167a88d9eb170781a04.tar.gz gnupg-48aae8167dcae80d43b08167a88d9eb170781a04.zip |
dirmngr: Properly handle SRV records.
* dirmngr/ks-engine-hkp.c (enum ks_protocol): New type.
(struct hostinfo_s): New flags indicating whether we already did a
A lookup, or a SRV lookup per protocol. Turn 'port' into an array.
(create_new_hostinfo): Initialize new fields.
(add_host): Update the port for the given protocol.
(map_host): Simplify hosttable lookup misses. Check the SRV records
for both protocols on demand, do the A lookup just once. Return the
correct port.
--
Previously, if a host had both a SRV record for hkp and hkps, the
wrong port was used for the protocol that was used second, because the
hostinfo did not store a port per protocol, and the hosttable does not
discriminate between hosts using the protocol.
Fix this by querying the SRV records on demand, storing a port per
protocol, and returning the right port.
GnuPG-bug-id: 3033
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'common/sysutils.h')
0 files changed, 0 insertions, 0 deletions