From 55e758315d4c088b749a3897ec6a9ef0d133800b Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 5 Jan 2015 22:34:02 +0100 Subject: [PATCH] - bugfix: using hmac key for hmac operations --- .../main/java/org/cryptomator/crypto/aes256/Aes256Cryptor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/crypto-aes/src/main/java/org/cryptomator/crypto/aes256/Aes256Cryptor.java b/main/crypto-aes/src/main/java/org/cryptomator/crypto/aes256/Aes256Cryptor.java index 1c2121b74..58afb9129 100644 --- a/main/crypto-aes/src/main/java/org/cryptomator/crypto/aes256/Aes256Cryptor.java +++ b/main/crypto-aes/src/main/java/org/cryptomator/crypto/aes256/Aes256Cryptor.java @@ -190,7 +190,7 @@ public class Aes256Cryptor extends AbstractCryptor implements AesCryptographicCo // decrypt and check password by catching AEAD exception final Cipher decCipher = aesKeyWrapCipher(kek, Cipher.UNWRAP_MODE); SecretKey primary = (SecretKey) decCipher.unwrap(keyfile.getPrimaryMasterKey(), AES_KEY_ALGORITHM, Cipher.SECRET_KEY); - SecretKey secondary = (SecretKey) decCipher.unwrap(keyfile.getPrimaryMasterKey(), HMAC_KEY_ALGORITHM, Cipher.SECRET_KEY); + SecretKey secondary = (SecretKey) decCipher.unwrap(keyfile.getHMacMasterKey(), HMAC_KEY_ALGORITHM, Cipher.SECRET_KEY); // everything ok, assign decrypted keys: this.primaryMasterKey = primary;