Neil wrote:
Nelson Bolyard wrote:

I'll add these thoughts. I don't know of any way to "log in" to a token that has no password. IINM, such a token just "comes up" in a state that is similar to being already logged in. It's not surprising to me that forcefully logging it out leaves it in a state where it cannot log in again without being restarted. Maybe the solution is to make it so that it cannot be logged out, since it is not truly logged in. That could be done in NSS or in PSM or in the browser outside of PSM (I think).
That might be possible if there was some easy way of determining whether there is a master password (without prompting the user for such password). This method would not need to leave the user logged in if they had previously been logged in with a password.

If I understand correctly what you are trying to do, you should try these two methods for login and logout

http://mxr.mozilla.org/mozilla-central/source/security/manager/ssl/src/nsPK11TokenDB.cpp#229
http://mxr.mozilla.org/mozilla-central/source/security/manager/ssl/src/nsPK11TokenDB.cpp#252


You just have to get instance of the internal token (it is the one that holds the keys and is protected by the master password) using this method:

http://mxr.mozilla.org/mozilla-central/source/security/manager/ssl/src/nsPK11TokenDB.cpp#471

I have never tried this myself, but it should IMO work for you.

-hb-

-- 
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to