-
Notifications
You must be signed in to change notification settings - Fork 9
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
Unlocking Secrets before retrieving them #45
Comments
See: secret-service/src/main/java/de/swiesend/secretservice/simple/SimpleCollection.java Lines 393 to 394 in d08ec91
You can use the high level API / KeePassXC's own secret service interfaces differ massively from the ones, gnome keyring does provide. You can't compare these two in this context from my point of view.
On the low level API, you can check for yourself: secret-service/src/main/java/de/swiesend/secretservice/Collection.java Lines 120 to 124 in d08ec91
|
But the problem is, that it is not possible to unlock the secrets from the simplecollection interface. I prepared a patch that I think would not harm if you only use gnome-keyring. Keepassxc follows the spec here, gnome keyring is just missing a feature for prompting if I want to use a secret. |
Why not? What is your code?
secret-service/src/main/java/de/swiesend/secretservice/simple/SimpleCollection.java Lines 372 to 386 in d08ec91
That prompts you, when the keyring is locked. |
Try this: SimpleCollection sc = new SimpleCollection();
var x = sc.getSecret("/org/freedesktop/secrets/collection/login/4"); You need the right objectPath for the secret you want to retrieve, of course. This reads the secret right away, when the keyring is unlocked, and prompts to unlock it otherwise. |
I see. KeepassXC is probably doing better in following the spec here. Until now this issue did not come up, as the gnome-keyring usually is not locking individual secret items. Never tried if that is even possible. I hope you can help yourself right now by building it on your own. In general I am trying to support KeepassXC with the 2.x.x branch. Will adapt and merge this to the branch. @SvenMarquardt5772 have you tested if there is a regression to the behaviour regarding gnome-keyring, apart from slowing down the retrieval through yet another remote call? Please ping me again if nothing happens within a week. @purejava thank you for looking into the issue swiftly. |
@swiesend its not possible in gnome-keyring to do that. I tested this in my local gnome-keyring version 3.36.0-1ubuntu1. And I saw no regression.
|
If I understand the spec correctly here
The client must ask the application to unlock the specific item before using get to retrieve the secret. For example, Keepassxc has a configuration, that asks with a prompt if I want to provide access to a secret to the specified application. Because of this, I cannot retrieve secrets. There should be a check, if the secret is locked, before trying to get it.
The text was updated successfully, but these errors were encountered: