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

crypto: reject non-int32 values in DiffieHellman() #32739

Closed
wants to merge 3 commits into from

Commits on Apr 10, 2020

  1. crypto: key size must be int32 in DiffieHellman()

    The JS code accepted any value where `typeof sizeOrKey === 'number'`
    was true but the C++ code checked that `args[0]->IsInt32()` and
    subsequently aborted.
    
    Fixes: nodejs#32738
    bnoordhuis committed Apr 10, 2020
    Copy the full SHA
    c090e6d View commit details
    Browse the repository at this point in the history
  2. crypto: generator must be int32 in DiffieHellman()

    Validate the generator argument in `crypto.createDiffieHellman(key, g)`.
    When it's a number, it should be an int32.
    
    Fixes: nodejs#32748
    bnoordhuis committed Apr 10, 2020
    Copy the full SHA
    a3d413a View commit details
    Browse the repository at this point in the history
  3. crypto: check DiffieHellman p and g params

    It's possible to pass in the prime and generator params as buffers
    but that mode of input wasn't as rigorously checked as numeric input.
    bnoordhuis committed Apr 10, 2020
    Copy the full SHA
    80ee6c0 View commit details
    Browse the repository at this point in the history