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

Invalid argument on verify method #407

Closed
RodriAndreotti opened this issue May 25, 2024 · 4 comments
Closed

Invalid argument on verify method #407

RodriAndreotti opened this issue May 25, 2024 · 4 comments

Comments

@RodriAndreotti
Copy link

RodriAndreotti commented May 25, 2024

Hi, could you help me to understando something?
I have used this library in another project last year, and everything worked like a charm.
Today i install it in another project (with updated release) and face the following behavior.

Steps to reproduce

  1. hash a password with following configs:
    { parallelism: 1, memoryCost: 64000, // 64 mb timeCost: 3, // number of itetations }

  2. Try to verify this same password with await argon2.verify(hash, Buffer.from(password), this.config);

Expected behaviour

The password could be verified successfully

Actual behaviour

When trying to verify password with previous generated hash the error Invalid argument occurs. This behavior happen only on 0.40+ versions, on version 0.31 everything works fine.

Environment

Debian Trixie

Node version:
Node 22

ranisalt added a commit that referenced this issue May 25, 2024
ranisalt added a commit that referenced this issue May 25, 2024
@ranisalt
Copy link
Owner

Found the issue! It's not possible to pass parallelism, memoryCost and timeCost to verify, since those are read from the hash, but omitting secret (the only possible option) causes it to fail on argon2_node.cpp#L94

@RodriAndreotti
Copy link
Author

Great news!
Thanks to the quickly return.
I'll wait for you to have some time to look at this.
But, thank you in advance!

And congratulations on the project.

@ranisalt
Copy link
Owner

@RodriAndreotti v0.40.3 has been published with a fix. Unfortunately, GitHub Actions is messing with me and I couldn't tag a release, but it's on NPM already so you can update on your project. Obrigado 😉

@RodriAndreotti
Copy link
Author

You're welcome.
I tried this new version and it's working like a charm:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants