-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid double-free errors in RSA key generation (#525)
* Avoid double-free of pub_exp (OpenSSL) * Avoid double-free of pub_exp (BoringSSL) We should not free pub_exp after we have successfully passed it into EVP_PKEY_CTX with EVP_PKEY_CTX_ctrl(EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP) call. Otherwise we'll free the same object twice when calling EVP_PKEY_CTX_free(). * Avoid double-free of EVP_PKEY_CTX (BoringSSL) We do not own pkey_ctx in soter_rsa_gen_key(). It is owned by the caller: soter_rsa_key_pair_gen_init(). We should not free it ourselves in case of errors. (And we should not use magic macros unless really necessary.)
- Loading branch information
Showing
2 changed files
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters