mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
dirmngr: Support Tor hidden services.
* dirmngr/dns-stuff.c (is_onion_address): New. * dirmngr/ks-engine-hkp.c (hostinfo_s): Add field "onion". (map_host): Special case onion addresses. (ks_hkp_print_hosttable): Print an 'O' for an onion address. * dirmngr/http.c (connect_server): Special case onion addresses. -- Note that this requires the latest libassuan from git. Onion addresses are always support regardless of the --use-tor flag. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
7735bbe539
commit
4524a2a371
4 changed files with 62 additions and 2 deletions
|
@ -403,6 +403,20 @@ is_ip_address (const char *name)
|
|||
}
|
||||
|
||||
|
||||
/* Return true if NAME is an onion address. */
|
||||
int
|
||||
is_onion_address (const char *name)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
len = name? strlen (name) : 0;
|
||||
if (len < 8 || strcmp (name + len - 6, ".onion"))
|
||||
return 0;
|
||||
/* Note that we require at least 2 characters before the suffix. */
|
||||
return 1; /* Yes. */
|
||||
}
|
||||
|
||||
|
||||
#ifdef USE_ADNS
|
||||
/* Init ADNS and store the new state at R_STATE. Returns 0 on
|
||||
success; prints an error message and returns an error code on
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue