Incorrect reliance on default encoding

Issue #249 resolved
Thierry De Leeuw created an issue

"getBytes()" should probably be replaced by "getBytes(Charset.forName("UTF-8"))" I found 4 occurences:

com.nimbusds.jose.crypto.AESCBC#encryptWithConcatKDF

byte[] mac = HMAC.compute(cik, macInput.getBytes(), macProvider);

com.nimbusds.jose.crypto.AESCBC#decryptWithConcatKDF

byte[] mac = HMAC.compute(cik, macInput.getBytes(), macProvider);

com.nimbusds.jose.crypto.LegacyConcatKDF#generateCEK

byte[] encBytes = enc.toString().getBytes();

com.nimbusds.jose.crypto.LegacyConcatKDF#generateCIK

byte[] encBytes = enc.toString().getBytes();

Comments (4)

  1. Log in to comment