forked from wolfSSL/wolfssl
Merge pull request #1109 from JacobBarthelmeh/Testing
fix check on ephemeral key type before free'ing
This commit is contained in:
@@ -4811,7 +4811,8 @@ void SSL_ResourceFree(WOLFSSL* ssl)
|
|||||||
FreeKey(ssl, DYNAMIC_TYPE_ECC, (void**)&ssl->peerEccDsaKey);
|
FreeKey(ssl, DYNAMIC_TYPE_ECC, (void**)&ssl->peerEccDsaKey);
|
||||||
ssl->peerEccDsaKeyPresent = 0;
|
ssl->peerEccDsaKeyPresent = 0;
|
||||||
#ifdef HAVE_CURVE25519
|
#ifdef HAVE_CURVE25519
|
||||||
if (!ssl->peerX25519KeyPresent)
|
if (!ssl->peerX25519KeyPresent &&
|
||||||
|
ssl->eccTempKeyPresent != DYNAMIC_TYPE_CURVE25519)
|
||||||
#endif /* HAVE_CURVE25519 */
|
#endif /* HAVE_CURVE25519 */
|
||||||
{
|
{
|
||||||
FreeKey(ssl, DYNAMIC_TYPE_ECC, (void**)&ssl->eccTempKey);
|
FreeKey(ssl, DYNAMIC_TYPE_ECC, (void**)&ssl->eccTempKey);
|
||||||
@@ -20693,7 +20694,8 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
ret = X25519MakeKey(ssl,
|
ret = X25519MakeKey(ssl,
|
||||||
(curve25519_key*)ssl->eccTempKey, NULL);
|
(curve25519_key*)ssl->eccTempKey, NULL);
|
||||||
if (ret == 0 || ret == WC_PENDING_E) {
|
if (ret == 0 || ret == WC_PENDING_E) {
|
||||||
ssl->eccTempKeyPresent = 1;
|
ssl->eccTempKeyPresent =
|
||||||
|
DYNAMIC_TYPE_CURVE25519;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -20715,7 +20717,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
then we know curve dp */
|
then we know curve dp */
|
||||||
ret = EccMakeKey(ssl, ssl->eccTempKey, NULL);
|
ret = EccMakeKey(ssl, ssl->eccTempKey, NULL);
|
||||||
if (ret == 0 || ret == WC_PENDING_E) {
|
if (ret == 0 || ret == WC_PENDING_E) {
|
||||||
ssl->eccTempKeyPresent = 1;
|
ssl->eccTempKeyPresent = DYNAMIC_TYPE_ECC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -3312,7 +3312,7 @@ struct WOLFSSL {
|
|||||||
#if defined(HAVE_ECC) || defined(HAVE_CURVE25519)
|
#if defined(HAVE_ECC) || defined(HAVE_CURVE25519)
|
||||||
word32 ecdhCurveOID; /* curve Ecc_Sum */
|
word32 ecdhCurveOID; /* curve Ecc_Sum */
|
||||||
ecc_key* eccTempKey; /* private ECDHE key */
|
ecc_key* eccTempKey; /* private ECDHE key */
|
||||||
byte eccTempKeyPresent;
|
byte eccTempKeyPresent; /* also holds type */
|
||||||
byte peerEccKeyPresent;
|
byte peerEccKeyPresent;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ECC
|
#ifdef HAVE_ECC
|
||||||
|
Reference in New Issue
Block a user