From cae86cd71fa3b1a6ed2db7541ae9bd786bba1764 Mon Sep 17 00:00:00 2001 From: Ralph Plawetzki Date: Wed, 7 Oct 2020 18:55:18 +0200 Subject: [PATCH] Get more information logged in case something goes wrong --- .../keychain/KeychainAccessStrategy.java | 2 +- .../keychain/LinuxKDEWalletKeychainAccessImpl.java | 13 +++++++++---- main/ui/src/main/resources/license/THIRD-PARTY.txt | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/main/keychain/src/main/java/org/cryptomator/keychain/KeychainAccessStrategy.java b/main/keychain/src/main/java/org/cryptomator/keychain/KeychainAccessStrategy.java index abd50287e..553ce4eab 100644 --- a/main/keychain/src/main/java/org/cryptomator/keychain/KeychainAccessStrategy.java +++ b/main/keychain/src/main/java/org/cryptomator/keychain/KeychainAccessStrategy.java @@ -5,7 +5,7 @@ *******************************************************************************/ package org.cryptomator.keychain; -interface KeychainAccessStrategy { +public interface KeychainAccessStrategy { /** * Associates a passphrase with a given key. 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 26d85b6d4..8e97dc6d4 100644 --- a/main/keychain/src/main/java/org/cryptomator/keychain/LinuxKDEWalletKeychainAccessImpl.java +++ b/main/keychain/src/main/java/org/cryptomator/keychain/LinuxKDEWalletKeychainAccessImpl.java @@ -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) { - LOG.error(e.toString(), e.getCause()); + 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) { - LOG.error(e.toString(), e.getCause()); + LOG.error("A KDEWallet could not be created:", e); return false; } } @@ -49,7 +50,7 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy 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); } } @@ -66,6 +67,7 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy } return (password.equals("")) ? null : password.toCharArray(); } catch (Exception e) { + LOG.error("Loading the passphrase failed:", e); throw new KeychainAccessException(e); } } @@ -82,6 +84,7 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy LOG.debug("Passphrase was not deleted."); } } catch (Exception e) { + LOG.error("Deleting the passphrase failed:", e); throw new KeychainAccessException(e); } } @@ -98,6 +101,7 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy LOG.debug("Passphrase could not be changed."); } } catch (Exception e) { + LOG.error("Changing the passphrase failed:", e); throw new KeychainAccessException(e); } } @@ -115,6 +119,7 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy 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/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)