Add NULL check after signature alg extension search

This commit is contained in:
Sean Parkinson 2017-08-01 08:56:38 +10:00
parent 7cee1c5e8a
commit 24e9f7c43d
3 changed files with 6 additions and 0 deletions

View File

@ -14284,6 +14284,9 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e)
case ALERT_COUNT_E:
return "Alert Count exceeded error";
case EXT_MISSING:
return "Required TLS extension missing";
default :
return "unknown error number";
}

View File

@ -3759,6 +3759,8 @@ static int SendTls13CertificateRequest(WOLFSSL* ssl, byte* reqCtx,
i += REQ_HEADER_SZ;
#else
ext = TLSX_Find(ssl->extensions, TLSX_SIGNATURE_ALGORITHMS);
if (ext == NULL)
return EXT_MISSING;
ext->resp = 0;
i = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;

View File

@ -163,6 +163,7 @@ enum wolfSSL_ErrorCodes {
INVALID_PARAMETER = -425, /* Security parameter invalid */
MCAST_HIGHWATER_CB_E = -426, /* Multicast highwater cb err */
ALERT_COUNT_E = -427, /* Alert Count exceeded err */
EXT_MISSING = -428, /* Required extension not found */
/* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */
/* begin negotiation parameter errors */