SSL: make temp X25519/X448 key failure

On failure to make the temporary X25519/X448 key, free it as the type is
stored in eccTempKeyPresent which also indicates a valid key is present.
Otherwise on SSL free, it will default to freeing the key with ECC APIs.
This commit is contained in:
Sean Parkinson
2023-11-27 08:50:22 +10:00
parent 008d4958bf
commit f65f8be176

View File

@@ -32894,6 +32894,10 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
ssl->eccTempKeyPresent =
DYNAMIC_TYPE_CURVE25519;
}
else {
FreeKey(ssl, DYNAMIC_TYPE_CURVE25519,
(void**)&ssl->eccTempKey);
}
}
break;
}
@@ -32917,6 +32921,10 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
ssl->eccTempKeyPresent =
DYNAMIC_TYPE_CURVE448;
}
else {
FreeKey(ssl, DYNAMIC_TYPE_CURVE448,
(void**)&ssl->eccTempKey);
}
}
break;
}