Whenever attempting to use crypto.pbkdf2* APIs, any time a Buffer
was used as an input the results from Trireme would differ from node.js
and the result is that the verification would fail. This commit fixes
that by making the following changes:
io.apigee.trireme.core.modules.Crypto$PBKDF2 now treats its input
arguments as Buffer objects.
io.apigee.trireme.kernel.util.StringUtils#stringToBuffer now properly
handles base64 encoded strings such that the returned ByteBuffer
only includes populated bytes. Before this change, if the actual
bytes in the Node.js Buffer were less than the ByteBuffer
allocated, the returned byte[] would have extra bytes on the end
and this broke crypto.pbkdf2*.
Tests were added to prove crypto.pbkdf2* works identically to
node.js and the previously commented out PBKDF2 tests were
uncommented.
Whenever attempting to use
crypto.pbkdf2*
APIs, any time aBuffer
was used as an input the results from Trireme would differ from node.js and the result is that the verification would fail. This commit fixes that by making the following changes:Buffer
objects.ByteBuffer
only includes populated bytes. Before this change, if the actual bytes in the Node.jsBuffer
were less than theByteBuffer
allocated, the returnedbyte[]
would have extra bytes on the end and this brokecrypto.pbkdf2*
.crypto.pbkdf2*
works identically to node.js and the previously commented out PBKDF2 tests were uncommented.