After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 151087 - Ability to change keyring password
Ability to change keyring password
Status: RESOLVED FIXED
Product: libgnome-keyring
Classification: Core
Component: General
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2004-08-26 02:49 UTC by W. Michael Petullo
Modified: 2019-02-22 11:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
api to change a keyrings password (12.50 KB, patch)
2006-04-03 00:57 UTC, Jon Nettleton
none Details | Review
forgot to add functions to gnome-keyring.h (13.76 KB, patch)
2006-04-03 01:49 UTC, Jon Nettleton
none Details | Review
All the changes discussed above included in a patch (25.57 KB, patch)
2006-04-10 23:29 UTC, Jon Nettleton
none Details | Review

Description W. Michael Petullo 2004-08-26 02:49:40 UTC
The gnome-keyring API should provide some method of changing a keyring's password.
Comment 1 Marius Andreiana 2005-02-21 10:32:24 UTC
Confirming
Comment 2 Jon Nettleton 2006-04-03 00:57:32 UTC
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.
Comment 3 Jon Nettleton 2006-04-03 01:49:48 UTC
Created attachment 62646 [details] [review]
forgot to add functions to gnome-keyring.h
Comment 4 Dan Williams 2006-04-03 19:48:42 UTC
Alex, can you comment on the latest patch from Comment #3 ?
Comment 5 Jon Nettleton 2006-04-04 01:19:55 UTC
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.
Comment 6 Jon Nettleton 2006-04-10 23:29:25 UTC
Created attachment 63211 [details] [review]
All the changes discussed above included in a patch
Comment 7 Jon Nettleton 2006-04-11 14:46:10 UTC
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.  
Comment 8 Alexander Larsson 2006-04-19 13:21:56 UTC
  	/* 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. :)