mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
Kyber: fix OQS memory leak
This commit is contained in:
@@ -356,6 +356,8 @@ int wc_KyberKey_MakeKey(KyberKey* key, WC_RNG* rng)
|
|||||||
ForceZero(key, sizeof(*key));
|
ForceZero(key, sizeof(*key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OQS_KEM_free(kem);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -432,6 +434,8 @@ int wc_KyberKey_Encapsulate(KyberKey* key, unsigned char* ct, unsigned char* ss,
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_PQM4 */
|
#endif /* HAVE_PQM4 */
|
||||||
|
|
||||||
|
OQS_KEM_free(kem);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,6 +523,8 @@ int wc_KyberKey_Decapsulate(KyberKey* key, unsigned char* ss,
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_PQM4 */
|
#endif /* HAVE_PQM4 */
|
||||||
|
|
||||||
|
OQS_KEM_free(kem);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* ext_kyber.c
|
/* ext_kyber.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2022 wolfSSL Inc.
|
* Copyright (C) 2006-2022 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user