}
#endif
-static int new_called = 0, remove_called = 0;
+static int new_called, remove_called, get_called;
static int new_session_cb(SSL *ssl, SSL_SESSION *sess)
{
static SSL_SESSION *get_session_cb(SSL *ssl, const unsigned char *id, int len,
int *copy)
{
+ get_called++;
*copy = 1;
return get_sess_val;
}
SSL_CTX_set_max_proto_version(sctx, maxprot);
SSL_CTX_set_options(sctx, SSL_OP_NO_TICKET);
- new_called = remove_called = 0;
+ new_called = remove_called = get_called = 0;
if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl1, &clientssl1,
NULL, NULL))
|| !TEST_true(create_ssl_connection(serverssl1, clientssl1,
if (use_ext_cache) {
SSL_SESSION *tmp = sess2;
- if (!TEST_int_eq(new_called, 1) || !TEST_int_eq(remove_called, 0))
+ if (!TEST_int_eq(new_called, 1)
+ || !TEST_int_eq(remove_called, 0)
+ || !TEST_int_eq(get_called, 0))
goto end;
/*
* Delete the session from the internal cache to force a lookup from
sess2 = tmp;
}
- new_called = remove_called = 0;
+ new_called = remove_called = get_called = 0;
get_sess_val = sess2;
if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl2,
&clientssl2, NULL, NULL))
|| !TEST_true(SSL_session_reused(clientssl2)))
goto end;
- if (use_ext_cache
- && (!TEST_int_eq(new_called, 0)
- || !TEST_int_eq(remove_called, 0)))
- goto end;
+ if (use_ext_cache) {
+ if (!TEST_int_eq(new_called, 0)
+ || !TEST_int_eq(remove_called, 0))
+ goto end;
+
+ if (maxprot == TLS1_3_VERSION) {
+ if (!TEST_int_eq(get_called, 0))
+ goto end;
+ } else {
+ if (!TEST_int_eq(get_called, 1))
+ goto end;
+ }
+ }
testresult = 1;