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

Fix incorrect error branch in ossl_bn_rsa_fips186_4_derive_prime() #20279

Closed

Commits on Feb 13, 2023

  1. Fix incorrect error branch in ossl_bn_rsa_fips186_4_derive_prime()

    BN_priv_rand_range_ex() and BN_add() both return a 0 on failure and a 1
    on success. In case of failure, the algorithm should fail. However, the
    branch that it goes through on failure is "goto end", not "goto err".
    Therefore, the algorithm will return 1 which indicates success instead
    of 0 for failure, leading to potential problems for the callers.
    Fix it by changing the goto to "goto err" instead of "goto end".
    
    CLA: trivial
    nielsdos committed Feb 13, 2023
    Copy the full SHA
    7f79858 View commit details
    Browse the repository at this point in the history