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

Implement ARGON2 hash #1165

Merged
merged 4 commits into from
Apr 14, 2017
Merged

Implement ARGON2 hash #1165

merged 4 commits into from
Apr 14, 2017

Conversation

sgdc3
Copy link
Member

@sgdc3 sgdc3 commented Apr 13, 2017

@sgdc3
Copy link
Member Author

sgdc3 commented Apr 13, 2017

@ljacqu we are only missing the test class i think

@sgdc3 sgdc3 requested a review from ljacqu April 13, 2017 23:45
@ljacqu
Copy link
Member

ljacqu commented Apr 14, 2017

Looks good so far but it doesn't work yet ;) A hash will never be checked against its password successfully; you need to override comparePassword so it goes over the Argon2 class.

You can generate the test class for Argon2 by using AbstractEncryptionMethodTest#generateTest

@sgdc3
Copy link
Member Author

sgdc3 commented Apr 14, 2017

You can generate the test class for Argon2 by using AbstractEncryptionMethodTest#generateTest

How? XD

@ljacqu
Copy link
Member

ljacqu commented Apr 14, 2017

     /** Generates a test class for a given encryption method. Simply create a test class and run the following code,
     * replacing {@code XXX} with the actual class:
     * <p>
     * <code>@org.junit.Test public void generate() { AbstractEncryptionMethodTest.generateTest(new XXX()); }</code>
     * <p>
     * The output is the entire test class. */

So just create an Argon2Test class, and in it have the code posted above and you're good to go ;)

Edit: i.e.,

  • create Argon2Test class
  • paste inside class: @org.junit.Test public void generate() { AbstractEncryptionMethodTest.generateTest(new Argon2()); }
  • run test, copy output
  • replace Argon2Test class with the copied output
  • run test again 😄

@sgdc3
Copy link
Member Author

sgdc3 commented Apr 14, 2017

Test is failing, any idea?

@ljacqu
Copy link
Member

ljacqu commented Apr 14, 2017

Hopefully fixed it. Reason is the test was confused because Argon2 extends UnsaltedMethod but it's very much salted—we just don't have to worry about it ourselves.

@sgdc3 sgdc3 merged commit bf38782 into master Apr 14, 2017
@ljacqu ljacqu deleted the argon2 branch April 29, 2017 07:22
@sgdc3 sgdc3 restored the argon2 branch June 1, 2017 10:42
timvisee added a commit that referenced this pull request Jun 1, 2017
@ljacqu ljacqu deleted the argon2 branch June 2, 2017 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants