You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even though a Base45 encoded string contains only characters from the alphabet in Table 1 the following case has to be considered: The string "FGW" represents 65535 (FFFF in base 16), which is a valid encoding. The string "GGW" would represent 65536 (10000 in base 16), which is represented by more than 16 bit.
Implementations MUST reject the encoded data if it contains a triplet of characters which, when decoded, results in an unsigned integer which is greater than 65535 (ffff in base 16).
But Base45Decoder accepts triplets representing integers greater than 65535, e.g. "GGW".
Expected behaviour
Base45Decoder().decode("GGW") should throw an exception, but returns a byte array with the bytes 0x01 0x00 0x00.
Steps to reproduce the issue
println(Base45Decoder().decode("GGW").joinToString(" ") { "%02X".format(it) }) prints 01 00 00.
The text was updated successfully, but these errors were encountered:
jcsahnwaldt
changed the title
Base45Decoder should reject triplets representing integers > 65535
Base45Decoder should reject triplets representing integers greater than 65535
Aug 12, 2021
* - reject the encoded data if it contains a triplet of characters which, when decoded, results in an unsigned integer which is greater than 65535 (ffff in base 16);
* - code formatting;
herald-si
added a commit
to herald-si/verificac19-sdk-php
that referenced
this issue
Nov 16, 2021
Describe the bug
https://datatracker.ietf.org/doc/html/draft-faltstrom-base45-07#section-6 says:
But Base45Decoder accepts triplets representing integers greater than 65535, e.g. "GGW".
Expected behaviour
Base45Decoder().decode("GGW")
should throw an exception, but returns a byte array with the bytes 0x01 0x00 0x00.Steps to reproduce the issue
println(Base45Decoder().decode("GGW").joinToString(" ") { "%02X".format(it) })
prints01 00 00
.The text was updated successfully, but these errors were encountered: