From: Daiki Ueno Date: Sat, 24 Nov 2018 15:00:48 +0000 (+0100) Subject: tests: remove unnecessary session creation in tls13/anti_replay X-Git-Tag: gnutls_3_6_5~13^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce7ef2fa590e30a43588bdb2cacce8371cd18ce8;p=thirdparty%2Fgnutls.git 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 --- 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); }