-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User prompted by Gnome Keyring / KDE Wallet when clicking on "Unlock..." #1526
User prompted by Gnome Keyring / KDE Wallet when clicking on "Unlock..." #1526
Comments
Maybe, inside integrations-linux, we need one more abstraction layer: Since we can't know if the keychain is currently unlocked (or can we?), we might want to store whether there should be a saved password in some config file, so we know when not to invoke the keychain API? |
At least the secret-service has a I'll check that out for both backends. |
According to the commits that introduced the Cryptomator inside password cache, this was done due to the fact, that calls to the backends are too expensive. |
Not really. We need to know if a stored password exists, when the user starts the unlock process. This is where we attempt to load it (if existing): cryptomator/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockModule.java Lines 49 to 63 in e4709ed
Maybe we can change line 53 to something like - if (!keychain.isSupported()) {
+ if (!keychain.isSupported() || keychain.isLocked()) { However, if there is a password inside a locked keychain, it would not prompt the user, even if he*she expected it. |
Yes, I think this is the right place for the change.
I tried to tug things together for a first draft, but could not manage to compile integrations-mac. I am missing something:
The single APIs (integrations-api, -linux, -mac and -win) do need to level up together. As I cannot compile integrations-mac, unfortunately I couldn't come any further than this. My code so far is here: What would be the best way to proceed from here? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I fixed the issue for the secret-service and the kdewallet backend. It was indeed necessary to add another abstraction layer to the integrations-api: This fix prevents the prompts to unlock the backends from coming up:
Two points need to be mentioned: after a review of the changes and before merging, @Override
public boolean isLocked() {
return true;
} Second for the implementation in the Cryptomator-Code:
it had no effect when I implemented the above statement in These changes are required to fix the issue: The changes were tested intensively and should be fine. |
It should, though. Accessing the keychain when it is locked, should cause an IllegalStateException, not return Changes to the integrations-* are fine. Feel free to open PRs. |
I though @purejava was it optimized as And I really like the KeePassXC access idea! @purejava did you come up with that idea? @overheadhunter the I try to find some time tomorrow to address all the issues. |
My comment referred to a proposed change in purejava@d947ffa, which simply returns "null" when it is impossible to access a locked keychain. In my opinion the caller is responsible for not attempting to load a password from a locked keychain. I.e. the callee should throw an ISE if its state doesn't allow to use this method. Rather fail early than emitting null values that cause hard-to-debug unexpected behaviour down the road. |
You are right. I must have looked into my not-up-to-date fork of your repo. Sorry for that!
Something like the following might work (untested): @Override
public boolean isLocked() {
try (@SuppressWarnings("unused") SimpleCollection keyring = new SimpleCollection()) {
// seems like we're able to access the keyring.
return keyring.isLocked();
} catch (IOException | ExceptionInInitializerError | RuntimeException e) {
return true;
}
}
No. This has no relevance for the question at hand.
Thank you. Yes, I noticed that KeePassXC is communicating with its browser-extensions via a proxy that KeePassXC provides and that this proxy can be accessed from other applications too. |
Regarding to the
for me it was sufficient to set
|
I need to correct this statement: it had no effect on creating a vault and on selecting a vault, but it does work for clicking Unlock.
Looking through the code I've found the right places for the changes.
I've tested the changes on both Linux backends and will create a PR. Please note, that on a locked backend, with this PR, a user that changes the password for a vault does not change the one that is saved in the backend! I don't know, if this is wanted. The alternative would be to always prompt to unlock the backend in case a password gets changed and the backend is locked. Both have pros and cons. For the user who brought up this issue (does not want to interact with a backend at all) the PR is fine. On the other hand, I can imagine a user that boots his machine to just quickly change the password of a vault and has her backend locked at that time. For her, the password in the backend would stay unchanged. You decide. |
An idea would be to add an ui element which reminds the user that the selected keychain is locked and changes in Cryptomator won't find its way into the used keychain. An alternative would be implementing a checkbox in the general preferences which switches between ignore keychain if it is locked and the previous behaviour. |
We could add a new (nullable) value to
Special cases:
|
Fixes #1526 Co-authored-by: Sebastian Stenzel <overheadhunter@users.noreply.github.com> Co-authored-by: Sebastian Stenzel <sebastian.stenzel@gmail.com>
Description
This is a follow-up on #1525. Essentially, the problem is that Cryptomator asks whether a password is stored, as soon as a user triggers the unlock workflow. While necessary, this has unwanted side effects on Linux, if no password is stored and the user doesn't expect any interaction with any 3rd party keychain.
System Setup
Steps to Reproduce
Expected Behavior
No interaction with Gnome Keyring / KDE Wallet
Actual Behavior
System keychain prompts the user.
Reproducibility
Always
Additional Information
@purejava has tracked this down to the eager access to stored passwords here:
cryptomator/main/commons/src/main/java/org/cryptomator/common/keychain/KeychainManager.java
Line 83 in e4709ed
The text was updated successfully, but these errors were encountered: