1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-31 00:03:07 +03:00

tests: Test vectors for related documentation

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2024-11-11 12:09:38 +01:00
parent 91e228b08b
commit a15c977cdc
2 changed files with 41 additions and 0 deletions

View File

@ -1127,6 +1127,9 @@ static void torture_ssh_check_hostname_syntax(void **state)
assert_int_equal(rc, SSH_OK);
rc = ssh_check_hostname_syntax("libssh.");
assert_int_equal(rc, SSH_OK);
// IDN
rc = ssh_check_hostname_syntax("xn--bcher-kva.tld");
assert_int_equal(rc, SSH_OK);
rc = ssh_check_hostname_syntax(NULL);
assert_int_equal(rc, SSH_ERROR);
@ -1170,6 +1173,9 @@ static void torture_ssh_check_hostname_syntax(void **state)
assert_int_equal(rc, SSH_ERROR);
rc = ssh_check_hostname_syntax("..");
assert_int_equal(rc, SSH_ERROR);
// IDN non-encoded
rc = ssh_check_hostname_syntax("bücher.tld");
assert_int_equal(rc, SSH_ERROR);
}
static void torture_ssh_check_username_syntax(void **state) {