tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 78a9158bf00e771dcfc41d7e992692b915f27689
parent 5c09230b4528ea77138fdb25e0aaf7d9ff90398c
Author: David Goulet <dgoulet@torproject.org>
Date:   Thu, 17 Oct 2019 08:52:21 -0400

socks: Add SocksPort flag ExtendedErrors

This new flag tells tor that it can send back the SOCKS5 extended error code
detailed in prop304.

Part of #30382

Signed-off-by: David Goulet <dgoulet@torproject.org>

Diffstat:
Msrc/app/config/config.c | 6+++++-
Msrc/core/or/entry_port_cfg_st.h | 3+++
2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/app/config/config.c b/src/app/config/config.c @@ -6919,7 +6919,7 @@ parse_port_config(smartlist_t *out, cache_ipv6 = 0, use_cached_ipv6 = 0, prefer_ipv6_automap = 1, world_writable = 0, group_writable = 0, relax_dirmode_check = 0, - has_used_unix_socket_only_option = 0; + has_used_unix_socket_only_option = 0, extended_errors = 0; int is_unix_tagged_addr = 0; const char *rest_of_line = NULL; @@ -7158,6 +7158,9 @@ parse_port_config(smartlist_t *out, } else if (!strcasecmp(elt, "KeepAliveIsolateSOCKSAuth")) { socks_iso_keep_alive = ! no; continue; + } else if (!strcasecmp(elt, "ExtendedErrors")) { + extended_errors = ! no; + continue; } if (!strcasecmpend(elt, "s")) @@ -7270,6 +7273,7 @@ parse_port_config(smartlist_t *out, if (! (isolation & ISO_SOCKSAUTH)) cfg->entry_cfg.socks_prefer_no_auth = 1; cfg->entry_cfg.socks_iso_keep_alive = socks_iso_keep_alive; + cfg->entry_cfg.extended_socks5_codes = extended_errors; smartlist_add(out, cfg); } diff --git a/src/core/or/entry_port_cfg_st.h b/src/core/or/entry_port_cfg_st.h @@ -48,6 +48,9 @@ struct entry_port_cfg_t { * do we prefer IPv6? */ unsigned int prefer_ipv6_virtaddr : 1; + /** For socks listeners: can we send back the extended SOCKS5 error code? */ + unsigned int extended_socks5_codes : 1; + }; #endif /* !defined(ENTRY_PORT_CFG_ST_H) */