Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Issue 1989753002: crypto: Enable overriding NSS DB location. (Closed)

Created:
4 years, 7 months ago by mithro
Modified:
4 years, 6 months ago
Reviewers:
Ryan Sleevi
CC:
chromium-reviews, agl, davidben
Base URL:
https://chromium.googlesource.com/chromium/src.git@long-file-name-test
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

crypto: Enable overriding NSS DB location. The NSS DB used by default is ~/.pki, in our layout tests we wish to override this DB location so the user's configuration doesn't leak into the test run. Provide a NSS_DEFAULT_DB_DIR environment variable to allow the path to be changed. NSS_DEFAULT_DB_DIR was choosen because there is already a NSS_DEFAULT_DB_TYPE (see https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Reference/NSS_environment_variables). BUG=595504

Patch Set 1 : Fixing wrong depends. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -5 lines) Patch
M crypto/nss_util.cc View 1 chunk +15 lines, -5 lines 0 comments Download

Messages

Total messages: 9 (3 generated)
mithro
Hi src/crypto/OWNERS, I'm currently trying to fix http://crbug.com/595504. The root cause of this bug is ...
4 years, 7 months ago (2016-05-18 05:37:36 UTC) #2
Ryan Sleevi
While I'm very sympathetic to the issues this is causing, I'm going to need to ...
4 years, 7 months ago (2016-05-18 06:00:39 UTC) #5
mithro
The problem is the user's .pki stuff leaking into what should be an isolated test ...
4 years, 7 months ago (2016-05-18 06:35:40 UTC) #6
Ryan Sleevi
On 2016/05/18 06:35:40, mithro wrote: > The problem is the user's .pki stuff leaking into ...
4 years, 7 months ago (2016-05-18 06:51:25 UTC) #7
mithro
It sounds like I'm not going to convince you otherwise, but thought I would add ...
4 years, 7 months ago (2016-05-18 07:41:50 UTC) #8
Ryan Sleevi
4 years, 7 months ago (2016-05-18 08:15:41 UTC) #9
On 2016/05/18 07:41:50, mithro wrote:

I know it seems like I'm being a pain about this. I appreciate you looking for
alternative solutions, and I'm sorry that it no doubt is frustrating. I assure
you I'm not trying to be a pain for a pains sake.

>  * Firefox uses it's own database in the user's Firefox profile rather than
> ~/.pki/nssdb

Firefox, as shipped by Mozilla (not distros), uses a hermetic copy of NSS, and
thus uses a hermetic copy of the cert database (because you can't mix DB
versions and NSS versions). We intentionally and explicitly have chosen not to
do this.

However, as shipped by many distros, the version of NSS shipped as part of the
system image will do all sorts of things. For example, as shipped by
RHEL/Fedora/CentOS, they force-load a variety of things in /etc and
system-related configurations. Which is exactly what Chromium picks up (on those
platforms), since NSS is being treated as part of LSB. 

>  * OpenOffice and LibreOffice have a MOZILLA_CERTIFICATE_FOLDER environment
> variable which can be set to anything.

Right, that's because NSS-as-deployed has been transitioning from single-app
mode (e.g. as with Firefox) into shared-mode (largely driven by
RHEL-and-friends), where shared is system-configured and non-user-overridable.
But even MOZILLA_CERTIFICATE_FOLDER was a workaround that predated the shared
DB.

I mention this mostly as an example of where something ends up "supported"
forever, with no clear understanding about who's using it, why it's being used,
or what would break if it was removed.

>  * If we have a layout test which adds a certificate which it doesn't clean
up,
> that certificate will now be used by any Chrome based browser.

Layout tests can't add certificates anymore (we explicitly removed the
application/x-x509-user-cert code), but otherwise, yes, this is true *on all
platforms*.

>  * There seems to be a "nodb_init" flag on line 723?

It's legacy code we haven't removed yet, but can safely be done so. It was from
when we used NSS more broadly (and was part of loading NSS into sandboxed
renderer processes for rendering). There's a ton of cleanup work related to NSS
that still needs to be done, especially around some of the TPM initialization
code (also in that file), now that we've transitioned off NSS for cryptographic
services. However, setting that would make all sorts of other things fail (was
never a supported config in the browser process on Linux).

Powered by Google App Engine
This is Rietveld 408576698