samdjstevens / java-totp

A java library for implementing Time-based One Time Passwords for Multi-Factor Authentication.
MIT License
422 stars 103 forks source link

Throws exception if DefaultCodeGenerator received null hash algo #11

Closed OlivierJaquemet closed 4 years ago

OlivierJaquemet commented 4 years ago

If by the DefaultCodeGenerator is instanciated with a null HashingAlgorithm (which happened to me due to invalid constant loading in a singleton...), the generator will fail during code generation with NullPointerException.

Prevent this by throwing exception in constructor.

samdjstevens commented 4 years ago

Awesome, thanks for this. Will try and release a new version of the library as soon as possible.

samdjstevens commented 4 years ago

Latest version 1.5.1 with the above fix is now released on maven central

OlivierJaquemet commented 4 years ago

Thank you @samdjstevens !