Wolfgang Rosenauer wrote:
Nelson B Bolyard schrieb:
Wolfgang Rosenauer wrote, On 2008-11-18 05:38:
Hi,

I'm trying to use Firefox with an sqlite based NSS. So far all the
certificate stuff still works as expected as far as I can see but the
password manager component is broken now:

The exposed error is this:

Login Manager: Initialization of storage component failed: [Exception...
"Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIPK11Token.initPassword]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"
location: "JS frame ::
file:///usr/lib/xulrunner-1.9.0.4/components/storage-Legacy.js ::
anonymous :: line 180"  data: no]

I tried to trace down as far as I could through the following failing calls:
Here's a little more of that call stack:

http://mxr.mozilla.org/mozilla/source/toolkit/components/passwordmgr/src/storage-Legacy.js#179
http://mxr.mozilla.org/mozilla/source/security/manager/ssl/src/nsPK11TokenDB.cpp#337

http://mxr.mozilla.org/mozilla/source/security/nss/lib/pk11wrap/pk11auth.c#449
http://mxr.mozilla.org/mozilla/source/security/nss/lib/softoken/pkcs11.c#3099
http://mxr.mozilla.org/mozilla/source/security/nss/lib/softoken/sftkpwd.c#1254
http://mxr.mozilla.org/mozilla/source/security/nss/lib/softoken/sdb.c#1514

sqlerr = sqlite3_exec(sqlDB, PW_CREATE_TABLE_CMD, NULL, 0, NULL);

fails with error code 6 which seems to be "SQLITE_LOCKED"

Any ideas?
This is in a call to C_InitPIN, which sets a new password on a DB.
This is not a "login" type call.  Is that what you really intended to do?

Hmm, now that you say that...
It's not much about what I intend to do since I'm just trying to use
Firefox ;-)
But yeah, it might go wrong before that trace already?

http://mxr.mozilla.org/mozilla/source/toolkit/components/passwordmgr/src/storage-Legacy.js#176

176         var token = tokenDB.getInternalKeyToken();
177         if (token.needsUserInit) {
178             this.log("Initializing key3.db with default blank
password.");
179             token.initPassword("");

Is it expected that token.needsUserInit is true if there already is a
NSS database without a master password? Probably not. I've just checked
what happens if I remove the token.needsUserInit case and it now doesn't
fail to load the login storage component anymore. But trying to save a
password still doesn't work as Firefox "fails to encrypt string".

Something must be broken in my NSS database :-(
It's true if there's an NSS database, but it hasn't been "Initialized" yet. Usually we don't store anything in the database until it's initialized. This coincides with your back trace above.... an initialized database already has all of it's tables.

One way you can get in this state is if you loose your key database (you also get in this state when you first create the database). Typically needsUserInit means there isn't a password record in your key database. Without this you can not store any keys. The difference between 'not initialized', 'doesn't have a master password', and 'has master a password' is as follows:

  1) 'not initialized' --- no password record.
2) 'doesn't have a master password' --- has a password record, and the password record is encrypted with a key derived from 'NULL' (\0). 3) 'has a master password' - has a password record, and key isn't derived from NULL.

The NSS tools usually create new databases and initializes them at the same time. I think mozilla creates new databases, and initializes them later.
Question: is this an updated profile, or is this a new profile?

bob
Thanks,
Wolfgang
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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

Reply via email to