diff --git a/main/commons-test/pom.xml b/main/commons-test/pom.xml index 3b81fa1c8..fca60c305 100644 --- a/main/commons-test/pom.xml +++ b/main/commons-test/pom.xml @@ -7,7 +7,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 commons-test Cryptomator common test dependencies diff --git a/main/commons/pom.xml b/main/commons/pom.xml index 87f37452a..5c9b14017 100644 --- a/main/commons/pom.xml +++ b/main/commons/pom.xml @@ -7,7 +7,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 commons Cryptomator common diff --git a/main/filesystem-api/pom.xml b/main/filesystem-api/pom.xml index 76d3f7443..ebb3d0dab 100644 --- a/main/filesystem-api/pom.xml +++ b/main/filesystem-api/pom.xml @@ -9,7 +9,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 filesystem-api Cryptomator filesystem: API diff --git a/main/filesystem-crypto-integration-tests/pom.xml b/main/filesystem-crypto-integration-tests/pom.xml index 52bb3b72e..f6a55d042 100644 --- a/main/filesystem-crypto-integration-tests/pom.xml +++ b/main/filesystem-crypto-integration-tests/pom.xml @@ -12,7 +12,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 filesystem-crypto-integration-tests Cryptomator filesystem: Encryption layer tests diff --git a/main/filesystem-crypto/pom.xml b/main/filesystem-crypto/pom.xml index 183eabcfd..26ebe456d 100644 --- a/main/filesystem-crypto/pom.xml +++ b/main/filesystem-crypto/pom.xml @@ -12,7 +12,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 filesystem-crypto Cryptomator filesystem: Encryption layer diff --git a/main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/CryptorImpl.java b/main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/CryptorImpl.java index 383449911..aaa099cb9 100644 --- a/main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/CryptorImpl.java +++ b/main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/CryptorImpl.java @@ -13,7 +13,6 @@ import static org.cryptomator.crypto.engine.impl.Constants.CURRENT_VAULT_VERSION import java.io.IOException; import java.nio.ByteBuffer; import java.security.InvalidKeyException; -import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.Arrays; @@ -25,7 +24,6 @@ import javax.crypto.spec.SecretKeySpec; import javax.security.auth.DestroyFailedException; import javax.security.auth.Destroyable; -import org.apache.commons.lang3.ArrayUtils; import org.cryptomator.common.LazyInitializer; import org.cryptomator.crypto.engine.Cryptor; import org.cryptomator.crypto.engine.FileContentCryptor; @@ -109,7 +107,7 @@ class CryptorImpl implements Cryptor { assert keyFile != null; // check version - if (!CURRENT_VAULT_VERSION.equals(keyFile.getVersion()) || ArrayUtils.isEmpty(keyFile.getVersionMac())) { + if (!CURRENT_VAULT_VERSION.equals(keyFile.getVersion())) { throw new UnsupportedVaultFormatException(keyFile.getVersion(), CURRENT_VAULT_VERSION); } @@ -117,12 +115,13 @@ class CryptorImpl implements Cryptor { try { final SecretKey kek = new SecretKeySpec(kekBytes, ENCRYPTION_ALG); this.macKey = AesKeyWrap.unwrap(kek, keyFile.getMacMasterKey(), MAC_ALG); - final Mac mac = new ThreadLocalMac(macKey, MAC_ALG).get(); - final byte[] versionMac = mac.doFinal(ByteBuffer.allocate(Integer.BYTES).putInt(CURRENT_VAULT_VERSION).array()); - if (!MessageDigest.isEqual(versionMac, keyFile.getVersionMac())) { - destroyQuietly(macKey); - throw new UnsupportedVaultFormatException(Integer.MAX_VALUE, CURRENT_VAULT_VERSION); - } + // future use (as soon as we need to prevent downgrade attacks): +// final Mac mac = new ThreadLocalMac(macKey, MAC_ALG).get(); +// final byte[] versionMac = mac.doFinal(ByteBuffer.allocate(Integer.BYTES).putInt(CURRENT_VAULT_VERSION).array()); +// if (!MessageDigest.isEqual(versionMac, keyFile.getVersionMac())) { +// destroyQuietly(macKey); +// throw new UnsupportedVaultFormatException(Integer.MAX_VALUE, CURRENT_VAULT_VERSION); +// } this.encryptionKey = AesKeyWrap.unwrap(kek, keyFile.getEncryptionMasterKey(), ENCRYPTION_ALG); } catch (InvalidKeyException e) { throw new InvalidPassphraseException(); diff --git a/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/CryptorImplTest.java b/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/CryptorImplTest.java index 3320f8398..de299c452 100644 --- a/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/CryptorImplTest.java +++ b/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/CryptorImplTest.java @@ -14,6 +14,7 @@ import org.cryptomator.crypto.engine.Cryptor; import org.cryptomator.crypto.engine.InvalidPassphraseException; import org.cryptomator.crypto.engine.UnsupportedVaultFormatException; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; public class CryptorImplTest { @@ -48,6 +49,7 @@ public class CryptorImplTest { cryptor.readKeysFromMasterkeyFile(testMasterKey.getBytes(), "asd"); } + @Ignore @Test(expected = UnsupportedVaultFormatException.class) public void testMasterkeyDecryptionWithMissingVersionMac() throws IOException { final String testMasterKey = "{\"version\":3,\"scryptSalt\":\"AAAAAAAAAAA=\",\"scryptCostParam\":2,\"scryptBlockSize\":8," // @@ -57,6 +59,7 @@ public class CryptorImplTest { cryptor.readKeysFromMasterkeyFile(testMasterKey.getBytes(), "asd"); } + @Ignore @Test(expected = UnsupportedVaultFormatException.class) public void testMasterkeyDecryptionWithWrongVersionMac() throws IOException { final String testMasterKey = "{\"version\":3,\"scryptSalt\":\"AAAAAAAAAAA=\",\"scryptCostParam\":2,\"scryptBlockSize\":8," // diff --git a/main/filesystem-inmemory/pom.xml b/main/filesystem-inmemory/pom.xml index 864c9cf64..ae432bb21 100644 --- a/main/filesystem-inmemory/pom.xml +++ b/main/filesystem-inmemory/pom.xml @@ -12,7 +12,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 filesystem-inmemory Cryptomator filesystem: In-memory mock diff --git a/main/filesystem-invariants-tests/pom.xml b/main/filesystem-invariants-tests/pom.xml index e096a5808..e16119a71 100644 --- a/main/filesystem-invariants-tests/pom.xml +++ b/main/filesystem-invariants-tests/pom.xml @@ -9,7 +9,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 filesystem-invariants-tests Cryptomator filesystem: Invariants tests diff --git a/main/filesystem-nameshortening/pom.xml b/main/filesystem-nameshortening/pom.xml index 1c0f54b0b..ea90e7ac8 100644 --- a/main/filesystem-nameshortening/pom.xml +++ b/main/filesystem-nameshortening/pom.xml @@ -12,7 +12,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 filesystem-nameshortening Cryptomator filesystem: Name shortening layer diff --git a/main/filesystem-nio/pom.xml b/main/filesystem-nio/pom.xml index ba69155dd..1fc9a3fbf 100644 --- a/main/filesystem-nio/pom.xml +++ b/main/filesystem-nio/pom.xml @@ -7,7 +7,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 filesystem-nio Cryptomator filesystem: NIO-based physical layer diff --git a/main/filesystem-stats/pom.xml b/main/filesystem-stats/pom.xml index 4c11ccc56..5e1d947a3 100644 --- a/main/filesystem-stats/pom.xml +++ b/main/filesystem-stats/pom.xml @@ -12,7 +12,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 filesystem-stats Cryptomator filesystem: Throughput statistics diff --git a/main/frontend-api/pom.xml b/main/frontend-api/pom.xml index d5fdb044d..f8617fc28 100644 --- a/main/frontend-api/pom.xml +++ b/main/frontend-api/pom.xml @@ -12,7 +12,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 frontend-api Cryptomator frontend: API diff --git a/main/frontend-webdav/pom.xml b/main/frontend-webdav/pom.xml index a003e7e1e..ce65c0100 100644 --- a/main/frontend-webdav/pom.xml +++ b/main/frontend-webdav/pom.xml @@ -12,7 +12,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 frontend-webdav Cryptomator frontend: WebDAV frontend diff --git a/main/pom.xml b/main/pom.xml index bd65326e2..51b9f8a93 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -7,7 +7,7 @@ 4.0.0 org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 pom Cryptomator diff --git a/main/uber-jar/pom.xml b/main/uber-jar/pom.xml index fd7898499..6163b9916 100644 --- a/main/uber-jar/pom.xml +++ b/main/uber-jar/pom.xml @@ -12,7 +12,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 uber-jar pom diff --git a/main/ui/pom.xml b/main/ui/pom.xml index 141baee70..06c071636 100644 --- a/main/ui/pom.xml +++ b/main/ui/pom.xml @@ -12,7 +12,7 @@ org.cryptomator main - 0.12.0-SNAPSHOT + 1.0.0 ui Cryptomator GUI