Author: jonesde
Date: Sat Jun 21 09:48:35 2008
New Revision: 670225
URL:
http://svn.apache.org/viewvc?rev=670225&view=revLog:
Added decryption try using old hex decoding in the exception catch block, which should catch where this usually needs to happen
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java?rev=670225&r1=670224&r2=670225&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java Sat Jun 21 09:48:35 2008
@@ -92,7 +92,15 @@
return UtilObject.getObject(decryptedBytes);
} catch (GeneralException e) {
- throw new EntityCryptoException(e);
+ try {
+ // try using the old/bad hex encoding approach; this is another path the code may take, ie if there is an exception thrown in decrypt
+ byte[] encryptedBytes = StringUtil.fromHexStringOldFunnyVariety(str);
+ byte[] decryptedBytes = DesCrypt.decrypt(this.getKey(keyName), encryptedBytes);
+ return UtilObject.getObject(decryptedBytes);
+ } catch (GeneralException e1) {
+ // NOTE: this throws the original exception back, not the new one if it fails using the other approach
+ throw new EntityCryptoException(e);
+ }
}
}