diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2015-06-04 22:43:58 +0200 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2015-06-05 18:51:38 +0200 |
commit | d9e5cfa6a7d95dfa31627a7f52f54e1ba7f28a79 (patch) | |
tree | 128a7bf79981a810edd0f5fe096dc3f38e7b3ac5 | |
parent | 91151899a74b48fbcc9d12f8e2f5b65aa8f8e7a5 (diff) | |
download | libssh-d9e5cfa6a7d95dfa31627a7f52f54e1ba7f28a79.tar.gz libssh-d9e5cfa6a7d95dfa31627a7f52f54e1ba7f28a79.tar.xz libssh-d9e5cfa6a7d95dfa31627a7f52f54e1ba7f28a79.zip |
tests: send more packets of various sizes
-rw-r--r-- | tests/client/torture_algorithms.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/client/torture_algorithms.c b/tests/client/torture_algorithms.c index 8ef8b35d..b435ea59 100644 --- a/tests/client/torture_algorithms.c +++ b/tests/client/torture_algorithms.c @@ -24,6 +24,7 @@ #include "torture.h" #include "libssh/libssh.h" #include "libssh/priv.h" +#include "libssh/session.h" static void setup(void **state) { @@ -39,6 +40,10 @@ static void teardown(void **state) { static void test_algorithm(ssh_session session, const char *algo, const char *hmac) { int rc; + char data[256]; + size_t len_to_test[] = {1,2,3,4,5,6,7,8,10,12,15,16,20,31,32,33,63,64,65, + 100,127,128}; + unsigned int i; rc = ssh_options_set(session, SSH_OPTIONS_HOST, torture_libssh_host()); assert_true(rc == SSH_OK); @@ -63,6 +68,14 @@ static void test_algorithm(ssh_session session, const char *algo, const char *hm rc = ssh_connect(session); assert_true(rc == SSH_OK); + /* send ignore packets of all sizes */ + memset(data,0,sizeof(data)); + for (i=0;i<(sizeof(len_to_test) / sizeof(size_t));++i){ + memset(data,'A', len_to_test[i]); + ssh_send_ignore(session, data); + ssh_handle_packets(session, 50); + } + rc = ssh_userauth_none(session, NULL); if (rc != SSH_OK) { rc = ssh_get_error_code(session); |