Skip to content

Commit

Permalink
fixup! Adding support for data en(de)cryption in JCEHandler
Browse files Browse the repository at this point in the history
Fix swapped arguments
  • Loading branch information
demsey committed Apr 27, 2015
1 parent 129a187 commit 382578b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jpos/src/main/java/org/jpos/security/BaseSMAdapter.java
Expand Up @@ -1031,7 +1031,7 @@ public byte[] encryptData(CipherMode cipherMode, SecureDESKey kd
evt.addMessage(new SimpleMsg("command", "Encrypt Data", cmdParameters));
byte[] encData = null;
try {
encData = encryptDataImpl(cipherMode, kd, iv, data);
encData = encryptDataImpl(cipherMode, kd, data, iv);
List<Loggeable> r = new ArrayList<Loggeable>();
r.add(new SimpleMsg("result", "Encrypted Data", encData));
if(iv != null)
Expand Down Expand Up @@ -1073,7 +1073,7 @@ public byte[] decryptData(CipherMode cipherMode, SecureDESKey kd
evt.addMessage(new SimpleMsg("command", "Decrypt Data", cmdParameters));
byte[] decData = null;
try {
decData = decryptDataImpl(cipherMode, kd, iv, data);
decData = decryptDataImpl(cipherMode, kd, data, iv);
List<Loggeable> r = new ArrayList<Loggeable>();
r.add(new SimpleMsg("result", "Decrypted Data", decData));
if(iv != null)
Expand Down Expand Up @@ -1706,7 +1706,7 @@ protected Pair<EncryptedPIN,byte[]> translatePINGenerateSM_MACImpl(MKDMethod mkd
* @return encrypted data
* @throws SMException
*/
public byte[] encryptDataImpl(CipherMode cipherMode, SecureDESKey kd
protected byte[] encryptDataImpl(CipherMode cipherMode, SecureDESKey kd
,byte[] data, byte[] iv) throws SMException {
throw new SMException("Operation not supported in: " + this.getClass().getName());
}
Expand All @@ -1720,7 +1720,7 @@ public byte[] encryptDataImpl(CipherMode cipherMode, SecureDESKey kd
* @return decrypted data
* @throws SMException
*/
public byte[] decryptDataImpl(CipherMode cipherMode, SecureDESKey kd
protected byte[] decryptDataImpl(CipherMode cipherMode, SecureDESKey kd
,byte[] data, byte[] iv) throws SMException {
throw new SMException("Operation not supported in: " + this.getClass().getName());
}
Expand Down

0 comments on commit 382578b

Please sign in to comment.