diff --git a/main/keychain/src/main/java/org/cryptomator/keychain/LinuxKDEWalletKeychainAccessImpl.java b/main/keychain/src/main/java/org/cryptomator/keychain/LinuxKDEWalletKeychainAccessImpl.java index 120bef435..8e97dc6d4 100644 --- a/main/keychain/src/main/java/org/cryptomator/keychain/LinuxKDEWalletKeychainAccessImpl.java +++ b/main/keychain/src/main/java/org/cryptomator/keychain/LinuxKDEWalletKeychainAccessImpl.java @@ -10,7 +10,7 @@ import org.slf4j.LoggerFactory; public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy { - private final Logger log = LoggerFactory.getLogger(LinuxKDEWalletKeychainAccessImpl.class); + private static final Logger LOG = LoggerFactory.getLogger(LinuxKDEWalletKeychainAccessImpl.class); private final String FOLDER_NAME = "Cryptomator"; private final String APP_NAME = "Cryptomator"; @@ -18,11 +18,12 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy private KDEWallet wallet; private int handle = -1; - public LinuxKDEWalletKeychainAccessImpl() { + public LinuxKDEWalletKeychainAccessImpl() throws KeychainAccessException { try { connection = DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION); } catch (DBusException e) { - e.printStackTrace(); + LOG.error("Connecting to D-Bus failed:", e); + throw new KeychainAccessException(e); } } @@ -32,7 +33,7 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy wallet = new KDEWallet(connection); return wallet.isEnabled(); } catch (Exception e) { - e.printStackTrace(); + LOG.error("A KDEWallet could not be created:", e); return false; } } @@ -44,12 +45,12 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy !(wallet.hasEntry(handle, FOLDER_NAME, key, APP_NAME) && wallet.entryType(handle, FOLDER_NAME, key, APP_NAME) == 1) && wallet.writePassword(handle, FOLDER_NAME, key, passphrase.toString(), APP_NAME) == 0) { - log.debug("Passphrase successfully stored."); + LOG.debug("Passphrase successfully stored."); } else { - log.debug("Passphrase was not stored."); + LOG.debug("Passphrase was not stored."); } } catch (Exception e) { - log.error(e.toString(), e.getCause()); + LOG.error("Storing the passphrase failed:", e); throw new KeychainAccessException(e); } } @@ -60,12 +61,13 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy try { if (walletIsOpen()) { password = wallet.readPassword(handle, FOLDER_NAME, key, APP_NAME); - log.debug("loadPassphrase: wallet is open."); + LOG.debug("loadPassphrase: wallet is open."); } else { - log.debug("loadPassphrase: wallet is closed."); + LOG.debug("loadPassphrase: wallet is closed."); } return (password.equals("")) ? null : password.toCharArray(); } catch (Exception e) { + LOG.error("Loading the passphrase failed:", e); throw new KeychainAccessException(e); } } @@ -77,11 +79,12 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy && wallet.hasEntry(handle, FOLDER_NAME, key, APP_NAME) && wallet.entryType(handle, FOLDER_NAME, key, APP_NAME) == 1 && wallet.removeEntry(handle, FOLDER_NAME, key, APP_NAME) == 0) { - log.debug("Passphrase successfully deleted."); + LOG.debug("Passphrase successfully deleted."); } else { - log.debug("Passphrase was not deleted."); + LOG.debug("Passphrase was not deleted."); } } catch (Exception e) { + LOG.error("Deleting the passphrase failed:", e); throw new KeychainAccessException(e); } } @@ -93,11 +96,12 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy && wallet.hasEntry(handle, FOLDER_NAME, key, APP_NAME) && wallet.entryType(handle, FOLDER_NAME, key, APP_NAME) == 1 && wallet.writePassword(handle, FOLDER_NAME, key, passphrase.toString(), APP_NAME) == 0) { - log.debug("Passphrase successfully changed."); + LOG.debug("Passphrase successfully changed."); } else { - log.debug("Passphrase could not be changed."); + LOG.debug("Passphrase could not be changed."); } } catch (Exception e) { + LOG.error("Changing the passphrase failed:", e); throw new KeychainAccessException(e); } } @@ -112,9 +116,10 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy wallet.openAsync(Static.DEFAULT_WALLET, 0, APP_NAME, false); wallet.getSignalHandler().await(KWallet.walletAsyncOpened.class, Static.ObjectPaths.KWALLETD5, () -> null); handle = wallet.getSignalHandler().getLastHandledSignal(KWallet.walletAsyncOpened.class, Static.ObjectPaths.KWALLETD5).handle; - log.debug("Wallet successfully initialized."); + LOG.debug("Wallet successfully initialized."); return handle != -1; } catch (Exception e) { + LOG.error("Asynchronous opening the wallet failed:", e); throw new KeychainAccessException(e); } } diff --git a/main/pom.xml b/main/pom.xml index 6dd36fca7..61e206686 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -34,7 +34,7 @@ 14 3.11 1.1.0 - 1.0.1 + 1.1.1 3.10.3 2.1.0 29.0-jre diff --git a/main/ui/src/main/resources/license/THIRD-PARTY.txt b/main/ui/src/main/resources/license/THIRD-PARTY.txt index 6b1d42e05..3674e5e05 100644 --- a/main/ui/src/main/resources/license/THIRD-PARTY.txt +++ b/main/ui/src/main/resources/license/THIRD-PARTY.txt @@ -82,7 +82,7 @@ Cryptomator uses 53 third-party dependencies under the following licenses: - zxcvbn4j (com.nulab-inc:zxcvbn:1.3.0 - https://github.com/nulab/zxcvbn4j) - secret-service (de.swiesend:secret-service:1.1.0 - https://github.com/swiesend/secret-service) - Checker Qual (org.checkerframework:checker-qual:2.11.1 - https://checkerframework.org) - - kdewallet (org.purejava:kdewallet:1.0.1 - https://github.com/purejava/kdewallet) + - kdewallet (org.purejava:kdewallet:1.1.1 - https://github.com/purejava/kdewallet) - SLF4J API Module (org.slf4j:slf4j-api:1.7.30 - http://www.slf4j.org) The BSD 2-Clause License: - EasyBind (com.tobiasdiez:easybind:2.1.0 - https://github.com/tobiasdiez/EasyBind)