- Problem:
- liblinkpeek.java was occasionally produced invalid security tokens.
- Diagnosis:
- Java's BigInteger strips leading zeros. This causes resulting MD5 hashes to be incorrect.
- Solution:
- Pad the security token (MD5 hash) with leading 0s until 32 characters in length.
while ( token.length() < 32 ) { token = "0" + token; } // pad with 0's
Special thanks goes out to Shazin Shafi Ahamed (https://bitbucket.org/shazinahmed) for reporting this bug and providing details on a possible patch.