Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<project.jdk.version>24</project.jdk.version>

<!-- runtime dependencies -->
<api.version>1.5.1</api.version>
<api.version>1.6.0</api.version>
<slf4j.version>2.0.17</slf4j.version>
<jackson.version>2.18.3</jackson.version>

Expand All @@ -47,6 +47,7 @@

<!-- build plugin dependencies -->
<mvn-surefire.version>3.5.3</mvn-surefire.version>
<mvn-failsafe.version>3.5.3</mvn-failsafe.version>
<dependency-check.version>12.1.1</dependency-check.version>
<central-publishing.version>0.7.0</central-publishing.version>
<jextract-maven.version>0.4.3</jextract-maven.version>
Expand Down Expand Up @@ -220,6 +221,19 @@
<argLine>-javaagent:"${net.bytebuddy:byte-buddy-agent:jar}"</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${mvn-failsafe.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.cryptomator.windows.keychain;

import org.cryptomator.integrations.common.LocalizedDisplayName;
import org.cryptomator.integrations.common.OperatingSystem;
import org.cryptomator.integrations.common.Priority;
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
Expand All @@ -11,6 +12,7 @@
*/
@Priority(1001)
@OperatingSystem(OperatingSystem.Value.WINDOWS)
@LocalizedDisplayName(bundle = "WinIntegrationsBundle", key ="org.cryptomator.windows.keychain.displayWindowsHelloName")
public final class WindowsHelloKeychainAccess extends WindowsKeychainAccessBase {

private static final String WINDOWS_HELLO_KEYCHAIN_PATHS_PROPERTY = "cryptomator.integrationsWin.windowsHelloKeychainPaths";
Expand All @@ -21,9 +23,4 @@ public WindowsHelloKeychainAccess() {
super(new FileKeychain(WINDOWS_HELLO_KEYCHAIN_PATHS_PROPERTY),
new WindowsHello(System.getProperty(WINDOWS_HELLO_KEY_ID_PROPERTY, "org.cryptomator.integrations-win")));
}

@Override
public String displayName() {
return Localization.get().getString("org.cryptomator.windows.keychain.displayWindowsHelloName");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected WindowsKeychainAccessBase(Keychain keychain, PassphraseCryptor passphr
}

@Override
public void storePassphrase(String id, String displayName, CharSequence passphrase, boolean ignored) throws KeychainAccessException {
public void storePassphrase(String id, String displayName, CharSequence passphrase) throws KeychainAccessException {
var keychainEntry = encryptPassphrase(passphrase);
keychain.put(id, keychainEntry);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.cryptomator.windows.keychain;

import org.cryptomator.integrations.common.DisplayName;
import org.cryptomator.integrations.common.LocalizedDisplayName;
import org.cryptomator.integrations.common.OperatingSystem;
import org.cryptomator.integrations.common.Priority;
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
Expand All @@ -11,6 +13,7 @@
*/
@Priority(1000)
@OperatingSystem(OperatingSystem.Value.WINDOWS)
@LocalizedDisplayName(bundle = "WinIntegrationsBundle", key = "org.cryptomator.windows.keychain.displayName")
public final class WindowsProtectedKeychainAccess extends WindowsKeychainAccessBase {

private static final String KEYCHAIN_PATHS_PROPERTY = "cryptomator.integrationsWin.keychainPaths";
Expand All @@ -20,9 +23,4 @@ public WindowsProtectedKeychainAccess() {
super(new FileKeychain(KEYCHAIN_PATHS_PROPERTY),new WinDataProtection());
}

@Override
public String displayName() {
return Localization.get().getString("org.cryptomator.windows.keychain.displayName");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public void testDeleteCommit() throws WindowsException {
@DisplayName("Set and get big value data")
@Order(11)
public void testLottaData() throws WindowsException {
var filler = "I like big nums and i cannot lie".repeat(1 << 16); //2 MiB
var filler = "I like big nums and i cannot lie".repeat(1 << 15); //1 MiB

try (var t = WindowsRegistry.startTransaction();
var k = t.createRegKey(RegistryKey.HKEY_CURRENT_USER, "org.cryptomator.integrations-win", true)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.cryptomator.windows.keychain;

import org.cryptomator.integrations.common.DisplayName;
import org.cryptomator.integrations.keychain.KeychainAccessException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -76,15 +77,12 @@ public void loadPassphraseReturnsPassphrase() throws KeychainAccessException {
Assertions.assertArrayEquals(new char[] {'a', 'b', 'c'}, result);
}

@DisplayName("TestProvider")
static class TestProvider extends WindowsKeychainAccessBase {

public TestProvider(Keychain keychain, PassphraseCryptor passphraseCryptor) {
super(keychain, passphraseCryptor);
}

@Override
public String displayName() {
return "TestProvider";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void notExistingFile() throws KeychainAccessException, IOException {
@DisplayName("A credential can be stored")
@Order(3)
public void testStoringCredential() throws KeychainAccessException, IOException {
keychainAccess.storePassphrase("ozelot", "oZeLoT", "abc", false);
keychainAccess.storePassphrase("ozelot", "oZeLoT", "abc");
var passphrase = keychainAccess.loadPassphrase("ozelot");
Assertions.assertEquals("abc", String.valueOf(passphrase));
}
Expand Down Expand Up @@ -97,7 +97,7 @@ public void testChangingCredentialNotExisting() throws KeychainAccessException,
@DisplayName("Existing credential can be changed")
@Order(7)
public void testChangingCredential() throws KeychainAccessException, IOException {
keychainAccess.storePassphrase("ozelot", "oZeLoT", "abc", false);
keychainAccess.storePassphrase("ozelot", "oZeLoT", "abc");
keychainAccess.changePassphrase("ozelot", "oZeLoT", "qwe");
var passphrase = keychainAccess.loadPassphrase("ozelot");
Assertions.assertEquals("qwe", String.valueOf(passphrase));
Expand Down