-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace malloc/free with OPENSSL_malloc/OpenSSL_free #1823
Comments
We certainly could do this, but I don't think it's very high on our priority list given the amount of manual effort it would require and the minimal (to my knowledge) improvement to the library. However, if you would like to take a stab at it, please feel free to open a PR for us to review. |
@baentsch @SWilson4
|
:> Would you like to run the script during merge the code from upstream, or during build the code? My preference would be to do this during
Not by default. If OQS_USE_OPENSSL=0, the current, openssl-free build must still succeed. Therefore, I'd suggest you'd add 2 macros in step 1 and define those suitably depending on the setting of OQS_USE_OPENSSL.
That's a scary question but a good one. Our usual recommendation is to contribute any fixes you develop to the upstreams so they flow back into |
In addition to the comment around fixing things, what would be really helpful would be if you @songlingatpan would be willing to share (contribute by PR to our CI) testing unearthing these problems so we can track (resolutions, hopefully, too :). |
To the best of my knowledge, none of the upstreams from which we pull code automatically (PQClean, pq-crystals, MAYO, and CROSS) use |
…sl allocator Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
…KEM, and NTRUPrime Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
…sl allocator Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
…KEM, and NTRUPrime Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
…sl allocator Signed-off-by: Songling Han <[email protected]> [open-quantum-safe#1823] update memory allocator for copy_from_upstream Signed-off-by: Songling Han <[email protected]> [open-quantum-safe#1823] format code Signed-off-by: Songling Han <[email protected]> [open-quantum-safe#1823] Use OpenSSL Memory Allocator for BIKE, FrodoKEM, and NTRUPrime Signed-off-by: Songling Han <[email protected]> [open-quantum-safe#1823] Add Comments for Doxygen Signed-off-by: Songling Han <[email protected]>
…sl allocator Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
…KEM, and NTRUPrime Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
…sl allocator Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
…KEM, and NTRUPrime Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
…sl allocator Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
…KEM, and NTRUPrime Signed-off-by: Songling Han <[email protected]>
Signed-off-by: Songling Han <[email protected]>
* [#1823] replace malloc/calloc/strdup/free with openssl allocator Signed-off-by: Songling Han <[email protected]> * [#1823] update memory allocator for copy_from_upstream Signed-off-by: Songling Han <[email protected]> * [#1823] Use OpenSSL Memory Allocator for BIKE, FrodoKEM, and NTRUPrime Signed-off-by: Songling Han <[email protected]> * [#1823] Add Comments for Doxygen Signed-off-by: Songling Han <[email protected]> * include openssl/crypto.h and resolve conflict varible for ntru Signed-off-by: Songling Han <[email protected]> * Add openssl version check to fix build error Signed-off-by: Songling Han <[email protected]> * Fix build for OQS_DLOPEN_OPENSSL Signed-off-by: Songling Han <[email protected]> * remove OQS_MEM_free Signed-off-by: Songling Han <[email protected]> * Add allocator check in tests/test_code_conventions.py Signed-off-by: Songling Han <[email protected]> * Add IGNORE memory-check Signed-off-by: Songling Han <[email protected]> * Delect checked allocation functions Signed-off-by: Songling Han <[email protected]> * Revert back p_param to p for sntrup Signed-off-by: Songling Han <[email protected]> * Add allocator check for '.c', '.h', '.fragment' Signed-off-by: Songling Han <[email protected]> * Add NULL for previous checked allocation Signed-off-by: Songling Han <[email protected]> * Add fprintf error for abort cases Signed-off-by: Songling Han <[email protected]> * use OQS_EXIT_IF_NULLPTR for checked malloc cases Signed-off-by: Songling Han <[email protected]> --------- Signed-off-by: Songling Han <[email protected]>
Completed in #1926. |
In OpenSSL code, we can customize malloc/free functions with CRYPTO_set_mem_functions.
in oqs provider, it also utilized OPENSSL_malloc/OPENSSL_free. so CRYPTO_set_mem_functions can be used to customize allocator.
We should replace malloc/free with OPENSSL_malloc/OpenSSL_free in liboqs as well.
The text was updated successfully, but these errors were encountered: