From d5ee850afec476f69e35a33d843a1fbe3a7a3191 Mon Sep 17 00:00:00 2001 From: Peter O'Neill Date: Thu, 25 Apr 2013 14:51:43 +0100 Subject: [PATCH] Fix bug with password storage, where some characters would lead to passwords not being remembered correctly. This was because the UTF-8 character map is used for encryption, but the platform default is used for decryption (which is ANSI for Windows 7). UTF-8 is now used both ways. --- .../sip/communicator/impl/credentialsstorage/AESCrypto.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/net/java/sip/communicator/impl/credentialsstorage/AESCrypto.java b/src/net/java/sip/communicator/impl/credentialsstorage/AESCrypto.java index 3f854aa12..63e6ef3cd 100644 --- a/src/net/java/sip/communicator/impl/credentialsstorage/AESCrypto.java +++ b/src/net/java/sip/communicator/impl/credentialsstorage/AESCrypto.java @@ -165,7 +165,8 @@ public String decrypt(String ciphertext) throws CryptoException try { decryptCipher.init(Cipher.DECRYPT_MODE, key); - return new String(decryptCipher.doFinal(Base64.decode(ciphertext))); + return new String(decryptCipher.doFinal(Base64.decode(ciphertext)), + "UTF-8"); } catch (BadPaddingException e) {