Skip to content

add timing-safe hmac verify method #688

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

Closed
wants to merge 1 commit into from

Conversation

arrtchiu
Copy link

I could be totally wrong, but it seems the standard library doesn't provide a reliable way of comparing hashes in constant-time.

With this patch I propose to add an additional method, OpenSSL::HMAC#verify, which takes a binary string with a digest and compares it against the computed hash.

I've also logged a feature request at https://bugs.ruby-lang.org/issues/10098 - since this is my first time contributing I'm not sure what constitutes a "tiny fix"; here's a pull request too.

@arrtchiu
Copy link
Author

Superceded by #689.

@arrtchiu arrtchiu closed this Jul 29, 2014
@arrtchiu arrtchiu deleted the timing-safe-hmac-verify branch July 29, 2014 04:01
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.

1 participant