Convert password storage to a SQLite database

From CDOT Wiki
Revision as of 20:30, 21 April 2008 by Rnesic (talk | contribs) (Project News)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Project Name

Convert password storage to a SQLite database

Project Description

Currently, Firefox stores logins in a text file in the user's profile (signons2.txt). The format is simple, but inflexible. Storage of other browser data, such as cookies and form history, has steadily been moving towards using SQLite-backed databases so moving password storage to the same kind of storage would be good. Some work was started in bug 288040.

Project Leader(s)

Radovan Nesic

Project Contributor(s)

Mrinal Kant

Project Details

Currently firefox currently writes usernames and passwords to a file in the users profile (signon2.txt). Instead of this, it will be written and read from a sqlite database. I've looked at some of the c++ source code for interacting with a sqlite db and it seems simple enough. But, firefox uses a unified storage system called mozstorage that to my understanding already handles db interactions. I'll have to look into this. Also, I'll have to look into the patches already released for this assignment.

The work on this project has been already started by other developers so i have to adjust my plans accordingly:

For the 0.1 release the plan is to play catch-up and to try to understand the scope of the work already done and the tasks still to be finished.

For the 0.2 release some serious coding needs to be done. The project is actually already near the fully functional phase (beyond and above the usual 0.3 status) at the time i joined in.

For the 0.3 release - i hope to have it fully functional (the actual 1.0 status) though this might prove to be a bit too ambitious.

NOTE: Since this bug has been decided not to be dealt with for the Firefox 3 release, no reviews for the patches have been planned before the FF3 release and branching off a new tree. See https://bugzilla.mozilla.org/show_bug.cgi?id=288040 for additional details.

Project News

At the time i got involved with the project it consisted of an additional source file storage-Sqlite.js and two patches - one for a file called all.js and the other for nsLoginManager.js developed by Mrinal Kant.

I was told that this solution does what it supposed to (it did - i tested it on my own build of minefield) but there are some issues with the way one function (initWithFile) interacts with other portions of the Mozilla source. My focus was to try and understand what exactly is the problem - so far i'm not much wiser than i was before i started.

In the meantime, recently the nsLoginManager.js (the file the second patch was applied to) has changed which broke the functionality. To fix this we need to get the categoryManager to correctly recognize the new sqlite password storage. I'm going to be looking into this - this is now a highest priority task.


v0.1

A very VERY trivial one - the existing patch for nsLoginManager.js is declared obsolete and removed from the code. See https://bugzilla.mozilla.org/show_bug.cgi?id=288040 for details.


v0.2

For the next release I'm thinking about going down the route suggested by Mike Shaver during our chat when he visited our class to give a lecture, and that is to implement the solution as an extension. Doing it this way will give me more freedom, but at the same time moving passwords onto SQLite is going to become a default sooner rather than later across the Mozilla world so having it implemented as an optional solution does not really make sense. In any case, for v0.2 my goal is to have the current solution re-packaged as an extension, and then for v0.3 and beyond to go into cleaning up the code and optimization.

v0.3

This is what i have so far - it's still not functional but i'll keep working on it.

http://zenit.senecac.on.ca/wiki/imgs/Storagesqlite.xpi