aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2024-04-30 11:54:42 +0200
committerTomas Mraz <tomas@openssl.org>2024-05-30 18:31:22 +0200
commit00a6d0743a38e179f5f9b5de4b73be9fcec0bb4c (patch)
treed964cda72c8902940685d8413ce5bb3b4589c06e /test
parent86c9bb137836036f2c95a2b2ee7abfd564b49708 (diff)
downloadopenssl-00a6d0743a38e179f5f9b5de4b73be9fcec0bb4c.zip
openssl-00a6d0743a38e179f5f9b5de4b73be9fcec0bb4c.tar.gz
openssl-00a6d0743a38e179f5f9b5de4b73be9fcec0bb4c.tar.bz2
ssl_sess.c: deprecate SSL_SESSION_get_time/SSL_SESSION_set_time
Adjust the manpages at the same time so that only the new functions are being presented. Fixes: #23648 Signed-off-by: Alexander Kanavin <alex@linutronix.de> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24307)
Diffstat (limited to 'test')
-rw-r--r--test/clienthellotest.c2
-rw-r--r--test/sslapitest.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/test/clienthellotest.c b/test/clienthellotest.c
index a86f1ab..935396a 100644
--- a/test/clienthellotest.c
+++ b/test/clienthellotest.c
@@ -164,7 +164,7 @@ static int test_client_hello(int currtest)
* We reset the creation time so that we don't discard the session as
* too old.
*/
- if (!TEST_true(SSL_SESSION_set_time(sess, (long)time(NULL)))
+ if (!TEST_true(SSL_SESSION_set_time_ex(sess, time(NULL)))
|| !TEST_true(SSL_set_session(con, sess)))
goto end;
}
diff --git a/test/sslapitest.c b/test/sslapitest.c
index 8a88558..e013838 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -2330,9 +2330,9 @@ static int execute_test_session(int maxprot, int use_int_cache,
*/
/* Make sess1 expire before sess2 */
- if (!TEST_long_gt(SSL_SESSION_set_time(sess1, 1000), 0)
+ if (!TEST_time_t_gt(SSL_SESSION_set_time_ex(sess1, 1000), 0)
|| !TEST_long_gt(SSL_SESSION_set_timeout(sess1, 1000), 0)
- || !TEST_long_gt(SSL_SESSION_set_time(sess2, 2000), 0)
+ || !TEST_time_t_gt(SSL_SESSION_set_time_ex(sess2, 2000), 0)
|| !TEST_long_gt(SSL_SESSION_set_timeout(sess2, 2000), 0))
goto end;
@@ -3991,7 +3991,7 @@ static int early_data_skip_helper(int testtype, int cipher, int idx)
* time. It could be any value as long as it is not within tolerance.
* This should mean the ticket is rejected.
*/
- if (!TEST_true(SSL_SESSION_set_time(sess, (long)(time(NULL) - 20))))
+ if (!TEST_true(SSL_SESSION_set_time_ex(sess, time(NULL) - 20)))
goto end;
}
@@ -9325,7 +9325,7 @@ static int test_session_timeout(int test)
SSL_SESSION *late = NULL;
SSL_CTX *ctx;
int testresult = 0;
- long now = (long)time(NULL);
+ time_t now = time(NULL);
#define TIMEOUT 10
if (!TEST_ptr(ctx = SSL_CTX_new_ex(libctx, NULL, TLS_method()))
@@ -9353,9 +9353,9 @@ static int test_session_timeout(int test)
|| !TEST_ptr(late->prev))
goto end;
- if (!TEST_int_ne(SSL_SESSION_set_time(early, now - 10), 0)
- || !TEST_int_ne(SSL_SESSION_set_time(middle, now), 0)
- || !TEST_int_ne(SSL_SESSION_set_time(late, now + 10), 0))
+ if (!TEST_time_t_ne(SSL_SESSION_set_time_ex(early, now - 10), 0)
+ || !TEST_time_t_ne(SSL_SESSION_set_time_ex(middle, now), 0)
+ || !TEST_time_t_ne(SSL_SESSION_set_time_ex(late, now + 10), 0))
goto end;
if (!TEST_int_ne(SSL_SESSION_set_timeout(early, TIMEOUT), 0)
@@ -9421,9 +9421,9 @@ static int test_session_timeout(int test)
/* make sure |now| is NOT equal to the current time */
now -= 10;
- if (!TEST_int_ne(SSL_SESSION_set_time(early, now), 0)
+ if (!TEST_time_t_ne(SSL_SESSION_set_time_ex(early, now), 0)
|| !TEST_int_eq(SSL_CTX_add_session(ctx, early), 1)
- || !TEST_long_ne(SSL_SESSION_get_time(early), now))
+ || !TEST_time_t_ne(SSL_SESSION_get_time_ex(early), now))
goto end;
testresult = 1;