forked from wolfSSL/wolfssl
Fixes for CID 184980 185017 185047 185167
This commit is contained in:
17
src/tls13.c
17
src/tls13.c
@ -953,7 +953,7 @@ static const byte writeIVLabel[WRITE_IV_LABEL_SZ+1] = "iv";
|
|||||||
*/
|
*/
|
||||||
static int DeriveTls13Keys(WOLFSSL* ssl, int secret, int side, int store)
|
static int DeriveTls13Keys(WOLFSSL* ssl, int secret, int side, int store)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret = BAD_FUNC_ARG; /* Assume failure */
|
||||||
int i = 0;
|
int i = 0;
|
||||||
#ifdef WOLFSSL_SMALL_STACK
|
#ifdef WOLFSSL_SMALL_STACK
|
||||||
byte* key_dig;
|
byte* key_dig;
|
||||||
@ -2012,12 +2012,15 @@ int BuildTls13Message(WOLFSSL* ssl, byte* output, int outSz, const byte* input,
|
|||||||
switch (ssl->options.buildMsgState) {
|
switch (ssl->options.buildMsgState) {
|
||||||
case BUILD_MSG_BEGIN:
|
case BUILD_MSG_BEGIN:
|
||||||
{
|
{
|
||||||
if (output == NULL || input == NULL)
|
/* catch mistaken sizeOnly parameter */
|
||||||
return BAD_FUNC_ARG;
|
if (sizeOnly) {
|
||||||
/* catch mistaken sizeOnly parameter */
|
if (output || input) {
|
||||||
if (sizeOnly && (output || input)) {
|
WOLFSSL_MSG("BuildTls13Message with sizeOnly "
|
||||||
WOLFSSL_MSG("BuildTls13Message with sizeOnly doesn't need "
|
"doesn't need input or output");
|
||||||
"input or output");
|
return BAD_FUNC_ARG;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (output == NULL || input == NULL) {
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user