diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2018-08-28 18:32:31 +0300 |
---|---|---|
committer | rl1987 <rl1987@sdf.lonestar.org> | 2018-08-28 18:32:31 +0300 |
commit | 3890ad25787ad6142acd65d064168ead53e9a289 (patch) | |
tree | 07672746ad57cc070b00037b9ec86afcd23ba5dc /src/test/test_hs_config.c | |
parent | 103dd68ba8e1d0780dee1ef1c02ccd2ed6cc0542 (diff) | |
download | tor-3890ad25787ad6142acd65d064168ead53e9a289.tar.gz tor-3890ad25787ad6142acd65d064168ead53e9a289.zip |
Stricter HiddenServicePort parsing
Diffstat (limited to 'src/test/test_hs_config.c')
-rw-r--r-- | src/test/test_hs_config.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/test_hs_config.c b/src/test/test_hs_config.c index 498d2df197..553b96758a 100644 --- a/src/test/test_hs_config.c +++ b/src/test/test_hs_config.c @@ -139,6 +139,20 @@ test_invalid_service(void *arg) teardown_capture_of_logs(); } + /* Bad target addr:port separation. */ + { + const char *conf = + "HiddenServiceDir /tmp/tor-test-hs-RANDOM/hs1\n" + "HiddenServiceVersion 2\n" + "HiddenServicePort 80 127.0.0.1 8000\n"; + setup_full_capture_of_logs(LOG_WARN); + ret = helper_config_service(conf, 1); + tt_int_op(ret, OP_EQ, -1); + expect_log_msg_containing("HiddenServicePort parse error: " + "invalid port mapping"); + teardown_capture_of_logs(); + } + /* Out of order directives. */ { const char *conf = |