sanity check on input length before secure renegotiation compare

This commit is contained in:
Jacob Barthelmeh
2020-04-07 10:10:03 -06:00
parent 9a1687d00e
commit 1ce0268477

View File

@ -4788,6 +4788,11 @@ static int TLSX_SecureRenegotiation_Parse(WOLFSSL* ssl, byte* input,
}
}
else if (*input == TLS_FINISHED_SZ) {
if (length < TLS_FINISHED_SZ + 1) {
WOLFSSL_MSG("SCR malformed buffer");
ret = BUFFER_E;
}
else {
input++; /* get past size */
/* validate client verify data */
@ -4802,6 +4807,7 @@ static int TLSX_SecureRenegotiation_Parse(WOLFSSL* ssl, byte* input,
WOLFSSL_MSG("SCR client verify data Failure");
}
}
}
#endif
}
else {