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

Replace pbkdf2 with argon2 via rust-argon2 #86

Merged
merged 6 commits into from Apr 13, 2020

Conversation

thespooler
Copy link
Contributor

@thespooler thespooler commented Apr 13, 2020

This is an alternative to #81 by using rust-argon2 instead of argonautica.
This avoids requiring clang as a dependency.

About argonautica, there's also argon2rs and rust-argon2. From what I see, argon2rs seems decent, pure rust and benchmarked. It doesn't do argon2id, only i or d variant and last commit is from 2017 and the maintainer is MIA from what I can glean from open issues.
rust-argon2 has recent commits and seems alive. Also, the talks on RustCrypto/password-hashes#1 might be of interest. They seem to come to a similar conclusion.

Related issues

@thespooler thespooler changed the base branch from master to next April 13, 2020 05:42
Copy link
Owner

@HeroicKatora HeroicKatora left a comment

Choose a reason for hiding this comment

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

I like this more than the weird build dependency. This means I finally got around to reviewing the actual crypto involved. Some issues there, it really shows how a good interface can make a crypto API more secure.

oxide-auth/src/primitives/registrar.rs Outdated Show resolved Hide resolved
oxide-auth/src/primitives/registrar.rs Outdated Show resolved Hide resolved
oxide-auth/src/primitives/registrar.rs Outdated Show resolved Hide resolved
oxide-auth/src/primitives/registrar.rs Outdated Show resolved Hide resolved
oxide-auth/src/primitives/registrar.rs Outdated Show resolved Hide resolved
oxide-auth/src/primitives/registrar.rs Outdated Show resolved Hide resolved
@thespooler
Copy link
Contributor Author

Since I rebased this off of next, do you want me to also include the actual removal of ring from cargo.toml and lib.rs?

Copy link
Owner

@HeroicKatora HeroicKatora left a comment

Choose a reason for hiding this comment

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

That seems like proper usage of ad now, I was expecting something slightly different in the untangling of functional code.

oxide-auth/src/primitives/registrar.rs Outdated Show resolved Hide resolved
oxide-auth/src/primitives/registrar.rs Outdated Show resolved Hide resolved
oxide-auth/src/primitives/registrar.rs Outdated Show resolved Hide resolved
@HeroicKatora
Copy link
Owner

Since I rebased this off of next, do you want me to also include the actual removal of ring from cargo.toml and lib.rs?

Not yet.

Copy link
Contributor Author

@thespooler thespooler left a comment

Choose a reason for hiding this comment

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

Fixed match errors while checking

oxide-auth/src/primitives/registrar.rs Outdated Show resolved Hide resolved
oxide-auth/src/primitives/registrar.rs Outdated Show resolved Hide resolved
oxide-auth/src/primitives/registrar.rs Outdated Show resolved Hide resolved
@thespooler
Copy link
Contributor Author

thespooler commented Apr 13, 2020

The impl From<argon2::Error> for RegistrarError and From<Utf8Error> seems overkill at first glance, but it does make the intent of the code in check() more obvious.

@HeroicKatora HeroicKatora merged commit f30ee6b into HeroicKatora:next Apr 13, 2020
@thespooler thespooler deleted the rust-argon2 branch April 13, 2020 16:01
@thespooler
Copy link
Contributor Author

Since I rebased this off of next, do you want me to also include the actual removal of ring from cargo.toml and lib.rs?

Not yet.

How about now? ;)

@HeroicKatora
Copy link
Owner

Separate PR, sure 👍

@thespooler thespooler mentioned this pull request Apr 13, 2020
2 tasks
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.

None yet

2 participants