mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Fix to only skip early key free if async pending.
This commit is contained in:
@ -18492,7 +18492,10 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
|
|||||||
args->sigSz = (word16)ret;
|
args->sigSz = (word16)ret;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
if (ret == 0) {
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
if (ret != WC_PENDING_E)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
/* peerRsaKey */
|
/* peerRsaKey */
|
||||||
FreeKey(ssl, DYNAMIC_TYPE_RSA,
|
FreeKey(ssl, DYNAMIC_TYPE_RSA,
|
||||||
(void**)&ssl->peerRsaKey);
|
(void**)&ssl->peerRsaKey);
|
||||||
@ -18516,7 +18519,10 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
|
|||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ret == 0) {
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
if (ret != WC_PENDING_E)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
/* peerEccDsaKey */
|
/* peerEccDsaKey */
|
||||||
FreeKey(ssl, DYNAMIC_TYPE_ECC,
|
FreeKey(ssl, DYNAMIC_TYPE_ECC,
|
||||||
(void**)&ssl->peerEccDsaKey);
|
(void**)&ssl->peerEccDsaKey);
|
||||||
@ -18540,7 +18546,10 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
|
|||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ret == 0) {
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
if (ret != WC_PENDING_E)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
/* peerEccDsaKey */
|
/* peerEccDsaKey */
|
||||||
FreeKey(ssl, DYNAMIC_TYPE_ED25519,
|
FreeKey(ssl, DYNAMIC_TYPE_ED25519,
|
||||||
(void**)&ssl->peerEd25519Key);
|
(void**)&ssl->peerEd25519Key);
|
||||||
@ -19794,7 +19803,11 @@ int SendClientKeyExchange(WOLFSSL* ssl)
|
|||||||
&ssl->arrays->preMasterSz,
|
&ssl->arrays->preMasterSz,
|
||||||
WOLFSSL_CLIENT_END
|
WOLFSSL_CLIENT_END
|
||||||
);
|
);
|
||||||
if (ret == 0 && !ssl->specs.static_ecdh) {
|
if (!ssl->specs.static_ecdh
|
||||||
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
&& ret != WC_PENDING_E
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
FreeKey(ssl, DYNAMIC_TYPE_CURVE25519,
|
FreeKey(ssl, DYNAMIC_TYPE_CURVE25519,
|
||||||
(void**)&ssl->peerX25519Key);
|
(void**)&ssl->peerX25519Key);
|
||||||
ssl->peerX25519KeyPresent = 0;
|
ssl->peerX25519KeyPresent = 0;
|
||||||
@ -19809,7 +19822,10 @@ int SendClientKeyExchange(WOLFSSL* ssl)
|
|||||||
&ssl->arrays->preMasterSz,
|
&ssl->arrays->preMasterSz,
|
||||||
WOLFSSL_CLIENT_END
|
WOLFSSL_CLIENT_END
|
||||||
);
|
);
|
||||||
if (ret == 0) {
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
if (ret != WC_PENDING_E)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
FreeKey(ssl, DYNAMIC_TYPE_ECC,
|
FreeKey(ssl, DYNAMIC_TYPE_ECC,
|
||||||
(void**)&ssl->peerEccKey);
|
(void**)&ssl->peerEccKey);
|
||||||
ssl->peerEccKeyPresent = 0;
|
ssl->peerEccKeyPresent = 0;
|
||||||
@ -19859,7 +19875,11 @@ int SendClientKeyExchange(WOLFSSL* ssl)
|
|||||||
&ssl->arrays->preMasterSz,
|
&ssl->arrays->preMasterSz,
|
||||||
WOLFSSL_CLIENT_END
|
WOLFSSL_CLIENT_END
|
||||||
);
|
);
|
||||||
if (ret == 0 && !ssl->specs.static_ecdh) {
|
if (!ssl->specs.static_ecdh
|
||||||
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
&& ret != WC_PENDING_E
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
FreeKey(ssl, DYNAMIC_TYPE_CURVE25519,
|
FreeKey(ssl, DYNAMIC_TYPE_CURVE25519,
|
||||||
(void**)&ssl->peerX25519Key);
|
(void**)&ssl->peerX25519Key);
|
||||||
ssl->peerX25519KeyPresent = 0;
|
ssl->peerX25519KeyPresent = 0;
|
||||||
@ -19878,7 +19898,11 @@ int SendClientKeyExchange(WOLFSSL* ssl)
|
|||||||
&ssl->arrays->preMasterSz,
|
&ssl->arrays->preMasterSz,
|
||||||
WOLFSSL_CLIENT_END
|
WOLFSSL_CLIENT_END
|
||||||
);
|
);
|
||||||
if (ret == 0 && !ssl->specs.static_ecdh) {
|
if (!ssl->specs.static_ecdh
|
||||||
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
&& ret != WC_PENDING_E
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
FreeKey(ssl, DYNAMIC_TYPE_ECC,
|
FreeKey(ssl, DYNAMIC_TYPE_ECC,
|
||||||
(void**)&ssl->peerEccKey);
|
(void**)&ssl->peerEccKey);
|
||||||
ssl->peerEccKeyPresent = 0;
|
ssl->peerEccKeyPresent = 0;
|
||||||
@ -25122,7 +25146,10 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
&ssl->arrays->preMasterSz,
|
&ssl->arrays->preMasterSz,
|
||||||
WOLFSSL_SERVER_END
|
WOLFSSL_SERVER_END
|
||||||
);
|
);
|
||||||
if (ret == 0) {
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
if (ret != WC_PENDING_E)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
FreeKey(ssl, DYNAMIC_TYPE_ECC,
|
FreeKey(ssl, DYNAMIC_TYPE_ECC,
|
||||||
(void**)&ssl->peerEccKey);
|
(void**)&ssl->peerEccKey);
|
||||||
ssl->peerEccKeyPresent = 0;
|
ssl->peerEccKeyPresent = 0;
|
||||||
@ -25171,7 +25198,10 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
&args->sigSz,
|
&args->sigSz,
|
||||||
WOLFSSL_SERVER_END
|
WOLFSSL_SERVER_END
|
||||||
);
|
);
|
||||||
if (ret == 0) {
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
if (ret != WC_PENDING_E)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
FreeKey(ssl, DYNAMIC_TYPE_CURVE25519,
|
FreeKey(ssl, DYNAMIC_TYPE_CURVE25519,
|
||||||
(void**)&ssl->peerX25519Key);
|
(void**)&ssl->peerX25519Key);
|
||||||
ssl->peerX25519KeyPresent = 0;
|
ssl->peerX25519KeyPresent = 0;
|
||||||
@ -25187,7 +25217,11 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
&args->sigSz,
|
&args->sigSz,
|
||||||
WOLFSSL_SERVER_END
|
WOLFSSL_SERVER_END
|
||||||
);
|
);
|
||||||
if (ret == 0 && !ssl->specs.static_ecdh) {
|
if (!ssl->specs.static_ecdh
|
||||||
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
&& ret != WC_PENDING_E
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
FreeKey(ssl, DYNAMIC_TYPE_ECC,
|
FreeKey(ssl, DYNAMIC_TYPE_ECC,
|
||||||
(void**)&ssl->peerEccKey);
|
(void**)&ssl->peerEccKey);
|
||||||
ssl->peerEccKeyPresent = 0;
|
ssl->peerEccKeyPresent = 0;
|
||||||
|
Reference in New Issue
Block a user