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

Added guard for invalid cost #58

Merged
merged 5 commits into from Apr 26, 2018

Conversation

2 participants
@bre7
Copy link
Contributor

bre7 commented Apr 26, 2018

Related to #57

Thanks @mcdappdev

@bre7 bre7 referenced this pull request Apr 26, 2018

Merged

Failing "password" test #57

@@ -26,6 +26,10 @@ public final class BCryptDigest {
/// - returns: BCrypt hash for the supplied plaintext data.
public func hash(_ plaintext: LosslessDataConvertible, cost: Int = 12, salt: LosslessDataConvertible? = nil) throws -> String {

guard cost >= 4 && cost <= 31 else {

This comment has been minimized.

@tanner0101

tanner0101 Apr 26, 2018

Member

Can/should we use the actual constants from the C lib here?

This comment has been minimized.

@bre7

bre7 Apr 26, 2018

Author Contributor

👍

@tanner0101 tanner0101 self-assigned this Apr 26, 2018

tanner0101 and others added some commits Apr 26, 2018

@tanner0101
Copy link
Member

tanner0101 left a comment

LGTM, thanks!

@tanner0101 tanner0101 merged commit 346ae2b into master Apr 26, 2018

5 checks passed

ci/circleci: linux Your tests passed on CircleCI!
Details
ci/circleci: linux-jwt Your tests passed on CircleCI!
Details
ci/circleci: linux-mysql Your tests passed on CircleCI!
Details
ci/circleci: linux-postgresql Your tests passed on CircleCI!
Details
ci/circleci: linux-vapor Your tests passed on CircleCI!
Details

@tanner0101 tanner0101 deleted the bre7-patch-1 branch Apr 26, 2018

@bre7

This comment has been minimized.

Copy link
Contributor Author

bre7 commented Apr 26, 2018

Not sure why there's no max #define macro (even if 31 isn't actually real)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment