forked from wolfSSL/wolfssl
add null sanity check to wolfSSL_SESSION_get_max_early_data, CID 516264
This commit is contained in:
@ -3534,6 +3534,10 @@ int wolfSSL_SESSION_get_master_key_length(const WOLFSSL_SESSION* ses)
|
|||||||
#ifdef WOLFSSL_EARLY_DATA
|
#ifdef WOLFSSL_EARLY_DATA
|
||||||
unsigned int wolfSSL_SESSION_get_max_early_data(const WOLFSSL_SESSION *session)
|
unsigned int wolfSSL_SESSION_get_max_early_data(const WOLFSSL_SESSION *session)
|
||||||
{
|
{
|
||||||
|
if (session == NULL) {
|
||||||
|
return BAD_FUNC_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
return session->maxEarlyDataSz;
|
return session->maxEarlyDataSz;
|
||||||
}
|
}
|
||||||
#endif /* WOLFSSL_EARLY_DATA */
|
#endif /* WOLFSSL_EARLY_DATA */
|
||||||
|
@ -1675,6 +1675,9 @@ static int test_quic_early_data(int verbose) {
|
|||||||
QuicTestContext_free(&tclient);
|
QuicTestContext_free(&tclient);
|
||||||
QuicTestContext_free(&tserver);
|
QuicTestContext_free(&tserver);
|
||||||
|
|
||||||
|
/* check for error value with null argument */
|
||||||
|
ExpectIntEQ(wolfSSL_SESSION_get_max_early_data(NULL), BAD_FUNC_ARG);
|
||||||
|
|
||||||
/* QUIC requires 0 or 0xffffffff as only allowed values.
|
/* QUIC requires 0 or 0xffffffff as only allowed values.
|
||||||
* Since we enabled early data in the server that created the session,
|
* Since we enabled early data in the server that created the session,
|
||||||
* we need to see it here. */
|
* we need to see it here. */
|
||||||
|
Reference in New Issue
Block a user