Closed Bug 435574 Opened 17 years ago Closed 17 years ago

Drop password request on startup

Categories

(Other Applications Graveyard :: McCoy, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mossop, Assigned: mossop)

References

Details

Attachments

(1 file)

Since McCoy is no longer all about the keys we should only request the password when necessary, not on every startup. Essentially backout bug 396168 and deal with any issues.
Attached patch patch rev 1Splinter Review
A little larger than I expected. This jimmies around the password handling and key store initialisation. It adds a new API for requesting keys from the user. By default it uses a known component in McCoy to both create a password for the store and log in to it. Different components can be provided though for testing and command line use cases where we do not want to show any UI to the user. We should not override the password callback for all of NSS though, instead when authenticating pass the keyservice as the context, nsNSSCallbacks will use it as an interface requestor to get an nsIPrompt for getting the password. The service now delays initialisation of the key store until needed, which is only when creating a key currently, or when explicitly logging in. This means that in a clean profile you can select a task, go through some steps and only when you create the key does it ask for a password. Subsequent runs will ask for the password as soon as you select the task since the keychooser needs to log in to see the key list.
Attachment #322468 - Flags: review?(mark.finkle)
Comment on attachment 322468 [details] [diff] [review] patch rev 1 >+++ b/chrome/content/changepw.xul >+ <script src="changepw.js"/> Did you know that using type="application/x-javascript" is the way to get newer JS stuff to work in your code? I learned that recently. Not a big deal for this XUL, but might be a maintenance issue later >+++ b/chrome/content/mccoy.js >@@ -56,7 +56,15 @@ function openWindowForType(type, uri, fe > } > > function openKeyManager() { >- openWindowForType("McCoy:KeyManager", "chrome://mccoy/content/keymanager.xul"); >+ var ks = Cc["@toolkit.mozilla.org/keyservice;1"]. >+ getService(Ci.nsIKeyService); >+ try { >+ ks.login(); >+ openWindowForType("McCoy:KeyManager", "chrome://mccoy/content/keymanager.xul"); >+ } Why the double call to the keymanager if ks.login doesn't throw? Doing this review was highly NSS educational (as they always seem to be), and yet I feel like I know very little NSS :( Looks good to me. Some really good code for teaching in here (McCoy in general too)
Attachment #322468 - Flags: review?(mark.finkle) → review+
Landed in r13891
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Blocks: 396158
Product: Other Applications → Other Applications Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: