-
Notifications
You must be signed in to change notification settings - Fork 289
Reject rounds=0 for SHA1 hashes #326
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
Conversation
@@ -145,6 +146,91 @@ public void testBasicHash() { | |||
} | |||
} | |||
|
|||
private void assertBuilderThrowsIllegalArgumentException(Md5.Builder builder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative to these helpers is to make all of the builders extend from a common interface (which they do: RepeatableHash.Builder) and make it public (which it isn't; and neither is RepeatableHash) even if it's just @VisibleForTesting
. I didn't do that, in the (naively?) optimistic hope that we'll update to java8 "soon" which will make all that unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be move this to InvalidHashTest
. There RepeatableHash
is already visible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah; that's definitely better. (Despite the name, I also used this file to test for valid hashes too.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. Just a couple of suggestions.
@@ -145,6 +146,91 @@ public void testBasicHash() { | |||
} | |||
} | |||
|
|||
private void assertBuilderThrowsIllegalArgumentException(Md5.Builder builder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be move this to InvalidHashTest
. There RepeatableHash
is already visible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM 👍
Port of firebase/firebase-admin-node#677