Merge pull request #2789 from JacobBarthelmeh/SanityChecks
fix return with error on process peer cert
This commit is contained in:
commit
651ffe2c12
@ -9992,16 +9992,16 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
||||
|
||||
/* Certificate Request Context */
|
||||
if ((args->idx - args->begin) + OPAQUE8_LEN > totalSz)
|
||||
return BUFFER_ERROR;
|
||||
ERROR_OUT(BUFFER_ERROR, exit_ppc);
|
||||
ctxSz = *(input + args->idx);
|
||||
args->idx++;
|
||||
if ((args->idx - args->begin) + ctxSz > totalSz)
|
||||
return BUFFER_ERROR;
|
||||
ERROR_OUT(BUFFER_ERROR, exit_ppc);
|
||||
#ifndef NO_WOLFSSL_CLIENT
|
||||
/* Must be empty when received from server. */
|
||||
if (ssl->options.side == WOLFSSL_CLIENT_END) {
|
||||
if (ctxSz != 0) {
|
||||
return INVALID_CERT_CTX_E;
|
||||
ERROR_OUT(INVALID_CERT_CTX_E, exit_ppc);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -10010,7 +10010,7 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
||||
if (ssl->options.side == WOLFSSL_SERVER_END) {
|
||||
if (ssl->options.handShakeState != HANDSHAKE_DONE &&
|
||||
ctxSz != 0) {
|
||||
return INVALID_CERT_CTX_E;
|
||||
ERROR_OUT(INVALID_CERT_CTX_E, exit_ppc);
|
||||
}
|
||||
else if (ssl->options.handShakeState == HANDSHAKE_DONE) {
|
||||
#ifdef WOLFSSL_POST_HANDSHAKE_AUTH
|
||||
@ -10033,7 +10033,7 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
||||
}
|
||||
if (curr == NULL)
|
||||
#endif
|
||||
return INVALID_CERT_CTX_E;
|
||||
ERROR_OUT(INVALID_CERT_CTX_E, exit_ppc);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user