diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2018-02-12 22:20:45 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-03-28 07:39:03 -0400 |
commit | db850fec3ac402084a9036c0ea7b4523f1120eb1 (patch) | |
tree | b8214d09eed6c9037ed153476954abfc4bf71949 /src/test/test_util.c | |
parent | 6335db9fce4275838c7de4bc10e522eb21a21ed8 (diff) | |
download | tor-db850fec3ac402084a9036c0ea7b4523f1120eb1.tar.gz tor-db850fec3ac402084a9036c0ea7b4523f1120eb1.zip |
Test TLD validation
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r-- | src/test/test_util.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index 2fa03e5bc7..db2ea1a348 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -5589,6 +5589,12 @@ test_util_hostname_validation(void *arg) tt_assert(!string_is_valid_hostname("[2a00:1450:401b:800::200e]")); tt_assert(!string_is_valid_hostname("2a00:1450:401b:800::200e")); + // Last label of a hostname is required to be alphabetic according to + // RFC 1123 Section 2.1. + tt_assert(!string_is_valid_hostname("lucky.13")); + tt_assert(!string_is_valid_hostname("luck.y13")); + tt_assert(!string_is_valid_hostname("luck.y13.")); + done: return; } |