summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2018-11-24 16:00:48 +0100
committerDaiki Ueno <dueno@redhat.com>2018-11-24 17:02:44 +0100
commitce7ef2fa590e30a43588bdb2cacce8371cd18ce8 (patch)
tree61bd62c4d1a10183a6e8d0c068fdb785f8b90b3e
parentfc3ddc11b79fc41623399c81aec6ba91da0e559c (diff)
downloadgnutls-ce7ef2fa590e30a43588bdb2cacce8371cd18ce8.tar.gz
tests: remove unnecessary session creation in tls13/anti_replay
This test only checks the behavior of _gnutls_anti_replay_check, thus session is not needed at all. Signed-off-by: Daiki Ueno <dueno@redhat.com>
-rw-r--r--tests/tls13/anti_replay.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/tests/tls13/anti_replay.c b/tests/tls13/anti_replay.c
index 31ab517151..d8636f0b43 100644
--- a/tests/tls13/anti_replay.c
+++ b/tests/tls13/anti_replay.c
@@ -84,7 +84,6 @@ void doit(void)
gnutls_datum_t key = { (unsigned char *) "\xFF\xFF\xFF\xFF", 4 };
struct timespec creation_time;
struct storage_st storage;
- gnutls_session_t session;
int ret;
virt_time_init();
@@ -96,13 +95,10 @@ void doit(void)
gnutls_anti_replay_set_window(anti_replay, 10000);
gnutls_anti_replay_set_add_function(anti_replay, storage_add);
gnutls_anti_replay_set_ptr(anti_replay, &storage);
- gnutls_init(&session, GNUTLS_SERVER);
- gnutls_anti_replay_enable(session, anti_replay);
mygettime(&creation_time);
ret = _gnutls_anti_replay_check(anti_replay, 10000, &creation_time, &key);
if (ret != GNUTLS_E_ILLEGAL_PARAMETER)
fail("error is not returned, while server_ticket_age < client_ticket_age\n");
- gnutls_deinit(session);
gnutls_anti_replay_deinit(anti_replay);
storage_clear(&storage);
@@ -112,14 +108,11 @@ void doit(void)
gnutls_anti_replay_set_add_function(anti_replay, storage_add);
gnutls_anti_replay_set_ptr(anti_replay, &storage);
gnutls_anti_replay_set_window(anti_replay, 10000);
- gnutls_init(&session, GNUTLS_SERVER);
- gnutls_anti_replay_enable(session, anti_replay);
mygettime(&creation_time);
virt_sec_sleep(30);
ret = _gnutls_anti_replay_check(anti_replay, 10000, &creation_time, &key);
if (ret != GNUTLS_E_EARLY_DATA_REJECTED)
fail("early data is NOT rejected, while freshness check fails\n");
- gnutls_deinit(session);
gnutls_anti_replay_deinit(anti_replay);
storage_clear(&storage);
@@ -129,8 +122,6 @@ void doit(void)
gnutls_anti_replay_set_add_function(anti_replay, storage_add);
gnutls_anti_replay_set_ptr(anti_replay, &storage);
gnutls_anti_replay_set_window(anti_replay, 10000);
- gnutls_init(&session, GNUTLS_SERVER);
- gnutls_anti_replay_enable(session, anti_replay);
mygettime(&creation_time);
virt_sec_sleep(15);
ret = _gnutls_anti_replay_check(anti_replay, 10000, &creation_time, &key);
@@ -139,7 +130,6 @@ void doit(void)
ret = _gnutls_anti_replay_check(anti_replay, 10000, &creation_time, &key);
if (ret != GNUTLS_E_EARLY_DATA_REJECTED)
fail("early data is NOT rejected for a duplicate key\n");
- gnutls_deinit(session);
gnutls_anti_replay_deinit(anti_replay);
storage_clear(&storage);
}