pqc: fix memory type for shared secret storage server side

This gets copied to preMasterSecret and freed in
TLSX_KeyShare_ProcessPqc with the SECRET type but is allocated
with the TLSX type.
This commit is contained in:
res0nance
2023-09-20 15:45:26 +08:00
parent 5bc5b8a99b
commit 0983ea9a80

View File

@ -8925,7 +8925,7 @@ static int server_generate_pqc_ciphertext(WOLFSSL* ssl,
if (ret == 0) {
sharedSecret = (byte*)XMALLOC(ecc_kse->keyLen + ssSz, ssl->heap,
DYNAMIC_TYPE_TLSX);
DYNAMIC_TYPE_SECRET);
ciphertext = (byte*)XMALLOC(ecc_kse->pubKeyLen + ctSz, ssl->heap,
DYNAMIC_TYPE_TLSX);
@ -8999,7 +8999,7 @@ static int server_generate_pqc_ciphertext(WOLFSSL* ssl,
TLSX_KeyShare_FreeAll(ecc_kse, ssl->heap);
if (sharedSecret != NULL)
XFREE(sharedSecret, ssl->heap, DYNAMIC_TYPE_TLSX);
XFREE(sharedSecret, ssl->heap, DYNAMIC_TYPE_SECRET);
if (ciphertext != NULL)
XFREE(ciphertext, ssl->heap, DYNAMIC_TYPE_TLSX);
wc_ecc_free(&eccpubkey);