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 rsaz 512 overflow bug [1.1.1] #10575

Commits on Dec 4, 2019

  1. Fix an overflow bug in rsaz_512_sqr

    There is an overflow bug in the x64_64 Montgomery squaring procedure used in
    exponentiation with 512-bit moduli. No EC algorithms are affected. Analysis
    suggests that attacks against 2-prime RSA1024, 3-prime RSA1536, and DSA1024 as a
    result of this defect would be very difficult to perform and are not believed
    likely. Attacks against DH512 are considered just feasible. However, for an
    attack the target would have to re-use the DH512 private key, which is not
    recommended anyway. Also applications directly using the low level API
    BN_mod_exp may be affected if they use BN_FLG_CONSTTIME.
    
    CVE-2019-1551
    Andy Polyakov authored and bernd-edlinger committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    75d8b19 View commit details
    Browse the repository at this point in the history
  2. Improve the overflow handling in rsaz_512_sqr

    We have always a carry in %rcx or %rbx in range 0..2
    from the previous stage, that is added to the result
    of the 64-bit square, but the low nibble of any square
    can only be 0, 1, 4, 9.
    
    Therefore one "adcq $0, %rdx" can be removed.
    Likewise in the ADX code we can remove one
    "adcx %rbp, $out" since %rbp is always 0, and carry is
    also zero, therefore that is a no-op.
    bernd-edlinger committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    69f98d5 View commit details
    Browse the repository at this point in the history
  3. Add a test case for rsaz_512_sqr overflow handling

    [extended tests]
    bernd-edlinger committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    6596604 View commit details
    Browse the repository at this point in the history

Commits on Dec 5, 2019

  1. Configuration menu
    Copy the full SHA
    db08aa1 View commit details
    Browse the repository at this point in the history