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: fix wrong error message #33482

Closed
wants to merge 5 commits into from
Closed

crypto: fix wrong error message #33482

wants to merge 5 commits into from

Commits on May 20, 2020

  1. crypto: fix wrong error message

    When calling `crypto.sign()`, if the `key` parameter object is
    missing the `key` property, the error message is wrong.
    
    Before the fix:
    TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of
    type string or an instance of Buffer, TypedArray, DataView, or
    KeyObject. Received an instance of Object
    
    Expected:
    TypeError [ERR_INVALID_ARG_TYPE]: The "key.key property" argument
    must be of type string or an instance of Buffer, TypedArray,
    DataView, or KeyObject. Received undefined
    
    Fixes: #33480
    This seems like a copy&paste bug. Somebody copied from the end of
    the function, where this is correct, to here, where it's wrong.
    benbucksch committed May 20, 2020
    Configuration menu
    Copy the full SHA
    b55a43b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0fb7721 View commit details
    Browse the repository at this point in the history
  3. Review comment

    benbucksch committed May 20, 2020
    Configuration menu
    Copy the full SHA
    8b06217 View commit details
    Browse the repository at this point in the history
  4. Adapt tests

    benbucksch committed May 20, 2020
    Configuration menu
    Copy the full SHA
    2148e9a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c4a3d0c View commit details
    Browse the repository at this point in the history