Skip to content
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

Avoid double-free errors in RSA key generation #525

Merged
merged 3 commits into from
Sep 5, 2019

Commits on Sep 4, 2019

  1. Avoid double-free of pub_exp (OpenSSL)

    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().
    ilammy committed Sep 4, 2019
    Configuration menu
    Copy the full SHA
    3f00936 View commit details
    Browse the repository at this point in the history
  2. 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_set_rsa_keygen_pubexp() call. Otherwise
    we'll free the same object twice when calling EVP_PKEY_CTX_free().
    ilammy committed Sep 4, 2019
    Configuration menu
    Copy the full SHA
    35108fe View commit details
    Browse the repository at this point in the history
  3. 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.)
    ilammy committed Sep 4, 2019
    Configuration menu
    Copy the full SHA
    ee4fb11 View commit details
    Browse the repository at this point in the history