Add OTP#getNextPin(), clean up code
master
MrLetsplay2024-09-07 19:48:16 +0200
1896eef707Incremented Version Count. Basically the issue was, that the standard for HOTP only specified the use of SHA-1 as an algorithm for the OTP and HOTP added the use of SHA-256 and SHA-512, which had a longer and different output length. MD5 on the other hand only uses 128 bytes of output, which could sometimes cause an IndexOutOfBounds Exception, when trying to read the last 4 bytes starting at byte 15. (Byte 16, 17 and 18 are outside the array bounds). Since the standard does not specify how to implement the algorithm using MD5, the best solution was to change the size of the array, instead of looping while fetching the values at the indices. This is because the specification is very clear about how to fetch the values: The Indices shall not loop, but rather just increment. Since this is not standard conforming, we can only hope, that this is compatible with other implementations, that feature MD5.
1.6
TheArrayser2023-09-24 14:55:52 +0200
ce1c2322f0Fixed issue with conflicting standards and custom implementation of extended standardTheArrayser2023-09-24 14:48:51 +0200