pyauth / pyotp

Python One-Time Password Library
https://pyauth.github.io/pyotp/
Other
3k stars 324 forks source link

at() method hangs when passed negative integers #40

Closed asweigart closed 7 years ago

asweigart commented 7 years ago

Running this code results in a hang:

hotp = pyotp.HOTP('base32secret3232') hotp.at(-1)

The at() method should probably raise an exception if it's passed a negative value.

tilkinsc commented 7 years ago

To counter the point 'probably raise an exception' part, I would argue that the user should have better control of what is passed into the library. A correct use would be taking a user input from the user, filter the inputs, and do the library stuff.... think of it like mysql.