-
Notifications
You must be signed in to change notification settings - Fork 23
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
PartialEq support #14
Comments
Hi! How would you implement it? Do you need to check for same secret? Or just same configuration (digits, period-length, period skew, algo) |
I mean you can make changes to the #[derive(Debug, Clone, PartialEq)]
struct TOTP {
...
} |
Seing issue #13 I should probably make sure the token comparison be done in constant time Since you're just thinking of deriving PartialEq, which is basically checking for every fields equality, I'll implement it but with constant time token comparison |
This feature request is irrelevant to issue #13. I need the PartialEq trait in order to use TOTP in an API that requires it. PartialEq has no effect on checking the token. |
It as an effect on comparing the secret* sorry this was a typo. I'm working on it |
Thanks! |
The eq method is not used to validate user input, so constant time comparison is not required in my humble opinion. |
I'm not sure how other people want to use this, so I preferred to err on the side of caution if there's use cases I haven't thought of. But yes, it should normally not be used to validate user input |
For my task, I need support for the PartialEq trait. Is it possible to implement the PartialEq trait for TOTP?
The text was updated successfully, but these errors were encountered: