GNOME Bugzilla – Bug 151087
Ability to change keyring password
Last modified: 2019-02-22 11:46:00 UTC
The gnome-keyring API should provide some method of changing a keyring's password.
Confirming
Created attachment 62645 [details] [review] api to change a keyrings password This patch includes the ability to change a keyrings password. It relies on the the fact that the they keyring is already unlocked. It only handles taking a new password, or getting one via dialogue, and setting it for an already unlocked keyring.
Created attachment 62646 [details] [review] forgot to add functions to gnome-keyring.h
Alex, can you comment on the latest patch from Comment #3 ?
I was thinking about this and wanted to add some additional commentary. I understand that it is bad practice to just change a keyring password based on the fact it is already unlocked. I wanted to get this chunk looked at to verify I was going in the right direction and it was implemented to gnome's satisfaction. Additional changes that need to be addressed, and discussed 1) Implement proto encode and decode functions for string_string_string. This will allow keyring, old_password, new_password to be passed to the daemon 2) Have op_change_keyring_password_collect lock the keyring if it isn't already then unlock it with old_password. This is where the design questions come into play. Currently unlock_keyring doesn't spawn a gnome-keyring-ask if the password is NULL. Is this correct? Should we verify the old_password with the traditional unlock keyring box or should we design different gnome-keyring-ask boxes for the various cases of old_password and new_password being NULL and needing user interaction. My first inclination is to just pop up the standard unlock keyring dialogue and on successful unlocking of the keyring pop up the new password dialogue I have already implemented. This all only gets more crazy with the pop-down effect of the current metacity. Any input would be great. I am sure I can bang out the code in no time if we decide on a direction.
Created attachment 63211 [details] [review] All the changes discussed above included in a patch
For easier testing of this code, I have created a patch to gnome-keyring-manager. It adds a menu item and dialog for Change keyring password. the patch is filed under gnome bugzilla #338088.
/* Add new ops here */ + GNOME_KEYRING_OP_CHANGE_KEYRING_PASSWORD, The op needs to go before the comment. + if (keyring_name == NULL) { + keyring_name = "default_keyring"; + } "default", not "default_keyring". finish_ask_io didn't seem to handle the case where the ask app didn't return three lines of text properly. I fixed this, and some indentation issues and commited. I've also branched for 2.14, so it should be ok to drop this on HEAD now. Please test it a bit to make sure i didn't break anything. :)