User stored certs as well as the intermediate certificate store should be memory-only by default in TorBrowser. This should be easy for user certs. No so sure about intermediate ones. Need to review the relevant code first.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related.
Learn more.
NSS_INIT_NOCERTDB seems to be the flag we want, and the NSS init appears to be called from nsNSSComponent::InitializeNSS(). It looks like we must hardcode this flag ourselves. But it also looks like a one-line patch for us (though adding an about:config option might make it a few lines).
It's not clear if this will explode everything or not. We'll need to test this and see what happens.
I imagine it is going to be a fun experience to try to build Firefox and learn to create a proper mercurial/git-formatted patch... otherwise this should be simple.
Ok, I banged on this for a while and can't seem to get it to work right. It is easy to make the intermediate cert store and other NSS dbs memory-only, but it does not appear easy to clear them at will.
It looks like Firefox's use of NSS is a crazy minefield of thread-safe and thread-unsafe accesses. I have some code that successfully re-initializes and clears NSS, but if any tabs are open with SSL pages in them, we get random segfaults and crashes.. I'm going to leave the code in the patch, but it is not run.
The pref needs to be set to the desired value at browser initialization, and cannot be toggled by Torbutton.
Note that the code that causes crashes is essentially the same codepath that Firefox itself uses during the profile switching event series. It may be the case that we actually need all SSL tabs to be closed for us to be able to shutdown and re-initialize NSS. In which case, we can remove the early return from this patch and still use it to clear cached certs in our implementation of "New Identity" (which would close all tabs as part of its mechanisms). But we'll want to test extensively that to make sure the race still isn't possible.
More notes to the future: It is possible that it is crashing in the cases where the profile change event would have been vetoed by the NSSComponent. I did not look into this as these cases are currently not logged. I actually altered the patch to avoid those codepaths entirely, because the prefchange is not vetoable like the profile change event is. If we could somehow create a blocking or cancel notification to our own new-identity observer event, this may be possible to do safely this way.
This kept bugging me so I banged on it some more to make the pref mimic an observer notification. I think I got it to stop crashing by checking to see if the component wanted to cancel shutdown, but the whole SSL system gets put into a broken state after a cancel, until such time as you try to shut it down again and then restart it. The cancel seems to be happening due to a long period of time between tab close and underlying SSL connection close.
So the user experience for a New-Identity based on this may not be good, unless we find a way to forcibly close any open SSL connections early.. But at least it seems to have stopped crashing.
If this ticket is about certs then why patch disables all dbs intead only one cert.db ? Why need to init nss using NSS_NoDB_Init instead of NSS_Initialize with NSS_INIT_NOCERTDB flag?
If this ticket is about certs then why patch disables all dbs intead only one cert.db ? Why need to init nss using NSS_NoDB_Init instead of NSS_Initialize with NSS_INIT_NOCERTDB flag?
Trac: Component: Firefox Patch Issues to Tor Browser Status: closed to reopened Severity: N/Ato Normal Sponsor: N/AtoN/A Resolution: fixed toN/A