File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8579,8 +8579,15 @@ static int TLSX_KeyShare_GenEccKey(WOLFSSL *ssl, KeyShareEntry* kse)
85798579 /* Cleanup on error, otherwise data owned by key share entry */
85808580 XFREE(kse->pubKey, ssl->heap, DYNAMIC_TYPE_PUBLIC_KEY);
85818581 kse->pubKey = NULL;
8582- if (eccKey != NULL)
8582+ if (eccKey != NULL) {
8583+ #if defined(WC_ECC_NONBLOCK) && defined(WOLFSSL_ASYNC_CRYPT_SW) && \
8584+ defined(WC_ASYNC_ENABLE_ECC)
8585+ if (eccKey->nb_ctx != NULL) {
8586+ XFREE(eccKey->nb_ctx, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER);
8587+ }
8588+ #endif
85838589 wc_ecc_free(eccKey);
8590+ }
85848591 XFREE(kse->key, ssl->heap, DYNAMIC_TYPE_PRIVATE_KEY);
85858592 kse->key = NULL;
85868593 }
@@ -9817,8 +9824,14 @@ static int TLSX_KeyShare_ProcessEcc_ex(WOLFSSL* ssl,
98179824 ssl->peerEccKey = NULL;
98189825 ssl->peerEccKeyPresent = 0;
98199826 }
9820- if (keyShareEntry->key) {
9821- wc_ecc_free((ecc_key*)keyShareEntry->key);
9827+ if (eccKey != NULL) {
9828+ #if defined(WC_ECC_NONBLOCK) && defined(WOLFSSL_ASYNC_CRYPT_SW) && \
9829+ defined(WC_ASYNC_ENABLE_ECC)
9830+ if (eccKey->nb_ctx != NULL) {
9831+ XFREE(eccKey->nb_ctx, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER);
9832+ }
9833+ #endif
9834+ wc_ecc_free(eccKey);
98229835 XFREE(keyShareEntry->key, ssl->heap, DYNAMIC_TYPE_ECC);
98239836 keyShareEntry->key = NULL;
98249837 }
You can’t perform that action at this time.
0 commit comments