mirror of https://github.com/wolfSSL/wolfssl.git
Merge pull request #3975 from TakayukiMatsuo/resumable
Add implementation for wolfSSL_SESSION_is_resumable.pull/3991/head
commit
6fad8c4a57
19
src/ssl.c
19
src/ssl.c
|
@ -55873,20 +55873,29 @@ void wolfSSL_set_psk_use_session_callback(WOLFSSL* ssl,
|
||||||
(void)ssl;
|
(void)ssl;
|
||||||
(void)cb;
|
(void)cb;
|
||||||
}
|
}
|
||||||
|
#endif /* NO_WOLFSSL_STUB */
|
||||||
/**
|
/**
|
||||||
* Determine whether a WOLFSSL_SESSION object can be used for resumption
|
* Determine whether a WOLFSSL_SESSION object can be used for resumption
|
||||||
* @param s a pointer to WOLFSSL_SESSION structure
|
* @param s a pointer to WOLFSSL_SESSION structure
|
||||||
* @return return 1 if session is resumable,
|
* @return return 1 if session is resumable, otherwise 0.
|
||||||
* otherwise 0 (currently always 0 with stub)
|
|
||||||
*/
|
*/
|
||||||
int wolfSSL_SESSION_is_resumable(const WOLFSSL_SESSION *s)
|
int wolfSSL_SESSION_is_resumable(const WOLFSSL_SESSION *s)
|
||||||
{
|
{
|
||||||
WOLFSSL_STUB("wolfSSL_SESSION_is_resumable");
|
if (s == NULL)
|
||||||
(void)s;
|
return 0;
|
||||||
|
|
||||||
|
#ifdef HAVE_SESSION_TICKET
|
||||||
|
if (s->ticketLen > 0)
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (s->sessionIDSz > 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* NO_WOLFSSL_STUB */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* free allocated memory resouce
|
* free allocated memory resouce
|
||||||
|
|
|
@ -32946,11 +32946,13 @@ static void test_wolfSSL_SESSION(void)
|
||||||
|
|
||||||
sess = wolfSSL_get_session(ssl);
|
sess = wolfSSL_get_session(ssl);
|
||||||
|
|
||||||
/* STUB */
|
|
||||||
#if defined(OPENSSL_EXTRA)
|
#if defined(OPENSSL_EXTRA)
|
||||||
AssertIntEQ(SSL_SESSION_is_resumable(sess), 0);
|
AssertIntEQ(SSL_SESSION_is_resumable(NULL), 0);
|
||||||
|
AssertIntEQ(SSL_SESSION_is_resumable(sess), 1);
|
||||||
#else
|
#else
|
||||||
AssertIntEQ(wolfSSL_SESSION_is_resumable(sess), 0);
|
AssertIntEQ(wolfSSL_SESSION_is_resumable(NULL), 0);
|
||||||
|
AssertIntEQ(wolfSSL_SESSION_is_resumable(sess), 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wolfSSL_shutdown(ssl);
|
wolfSSL_shutdown(ssl);
|
||||||
|
|
Loading…
Reference in New Issue