diff options
Diffstat (limited to 'src/feature/rend/rendservice.c')
-rw-r--r-- | src/feature/rend/rendservice.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/feature/rend/rendservice.c b/src/feature/rend/rendservice.c index 1af9117aaf..37e604d07d 100644 --- a/src/feature/rend/rendservice.c +++ b/src/feature/rend/rendservice.c @@ -451,11 +451,19 @@ rend_service_parse_port_config(const char *string, const char *sep, int is_unix; ret = port_cfg_line_extract_addrport(addrport_element, &addrport, &is_unix, &rest); + if (ret < 0) { tor_asprintf(&err_msg, "Couldn't process address <%s> from hidden " "service configuration", addrport_element); goto err; } + + if (rest && strlen(rest)) { + err_msg = tor_strdup("HiddenServicePort parse error: invalid port " + "mapping"); + goto err; + } + if (is_unix) { socket_path = addrport; is_unix_addr = 1; @@ -1652,7 +1660,7 @@ rend_service_load_auth_keys(rend_service_t *s, const char *hfname) crypto_pk_free(prkey); goto err; } - if (crypto_pk_check_key(prkey) <= 0) { + if (! crypto_pk_is_valid_private_key(prkey)) { log_warn(LD_BUG,"Generated client key seems invalid"); crypto_pk_free(prkey); goto err; |