Skip to content

Reject rounds=0 for SHA1 hashes - #326

Merged
rsgowman merged 2 commits into
masterfrom
rsgowman/rounds0
Nov 5, 2019
Merged

Reject rounds=0 for SHA1 hashes#326
rsgowman merged 2 commits into
masterfrom
rsgowman/rounds0

Conversation

@rsgowman

@rsgowman rsgowman commented Nov 1, 2019

Copy link
Copy Markdown
Member

@rsgowman rsgowman self-assigned this Nov 1, 2019
}
}

private void assertBuilderThrowsIllegalArgumentException(Md5.Builder builder) {

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Member Author

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.)

@rsgowman
rsgowman requested a review from hiranya911 November 1, 2019 19:51
@rsgowman rsgowman assigned hiranya911 and unassigned rsgowman Nov 1, 2019

@hiranya911 hiranya911 left a comment

Copy link
Copy Markdown
Contributor

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.

}
}

private void assertBuilderThrowsIllegalArgumentException(Md5.Builder builder) {

Copy link
Copy Markdown
Contributor

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.

Comment thread src/test/java/com/google/firebase/auth/UserImportHashTest.java Outdated
@hiranya911 hiranya911 assigned rsgowman and unassigned hiranya911 Nov 1, 2019

@hiranya911 hiranya911 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM 👍

@rsgowman
rsgowman merged commit b7b7125 into master Nov 5, 2019
@rsgowman
rsgowman deleted the rsgowman/rounds0 branch November 5, 2019 18:38
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

Successfully merging this pull request may close these issues.

2 participants