From 1896eef7078475c3f09680c6437e9d16bbfa533f Mon Sep 17 00:00:00 2001 From: TheArrayser Date: Sun, 24 Sep 2023 14:55:52 +0200 Subject: [PATCH] Incremented 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. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4771133..813e20a 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.cringe_studios CringeAuthenticatorLibrary - 1.5 + 1.6 CringeAuthenticatorLibrary The Library of the Cringe Authenticator