Reject rounds=0 for SHA1 hashes - #326
Conversation
| } | ||
| } | ||
|
|
||
| private void assertBuilderThrowsIllegalArgumentException(Md5.Builder builder) { |
There was a problem hiding this comment.
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.
May be move this to InvalidHashTest. There RepeatableHash is already visible.
There was a problem hiding this comment.
Oh, yeah; that's definitely better. (Despite the name, I also used this file to test for valid hashes too.)
hiranya911
left a comment
There was a problem hiding this comment.
Looks pretty good. Just a couple of suggestions.
| } | ||
| } | ||
|
|
||
| private void assertBuilderThrowsIllegalArgumentException(Md5.Builder builder) { |
There was a problem hiding this comment.
May be move this to InvalidHashTest. There RepeatableHash is already visible.
Port of firebase/firebase-admin-node#677