modified handler to return error on invalid condition post review

update
This commit is contained in:
kaleb-himes 2016-10-25 10:55:41 -06:00
parent 33ab901b3f
commit bc1fca5620

View File

@ -17564,7 +17564,10 @@ int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
#ifndef NO_RSA #ifndef NO_RSA
case rsa_sa_algo: case rsa_sa_algo:
{ {
if (verifySig == NULL && ssl->sigLen > 0) { if (verifySig == NULL) {
if (ssl->sigLen == 0) {
ERROR_OUT(BAD_COND_E, exit_sske);
}
verifySig = (byte*)XMALLOC(ssl->sigLen, ssl->heap, verifySig = (byte*)XMALLOC(ssl->sigLen, ssl->heap,
DYNAMIC_TYPE_TMP_BUFFER); DYNAMIC_TYPE_TMP_BUFFER);
if (!verifySig) { if (!verifySig) {
@ -17610,7 +17613,10 @@ int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
break; break;
} }
if (verifySig == NULL && ssl->sigLen > 0) { if (verifySig == NULL) {
if (ssl->sigLen == 0) {
ERROR_OUT(BAD_COND_E, exit_sske);
}
verifySig = (byte*)XMALLOC(ssl->sigLen, ssl->heap, verifySig = (byte*)XMALLOC(ssl->sigLen, ssl->heap,
DYNAMIC_TYPE_TMP_BUFFER); DYNAMIC_TYPE_TMP_BUFFER);
if (!verifySig) { if (!verifySig) {