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

Issue 6684018: Initialize NSS with no DB in the renderer process (Closed)

Created:
9 years, 9 months ago by Alpha Left Google
Modified:
7 years, 2 months ago
Reviewers:
wtc
CC:
chromium-reviews, jam, darin-cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Initialize NSS with no DB in the renderer process This change will allow the use of SSLClientSocketNSS to be used in the renderer process. This is needed by chromoting client to establish SSL connections. There are several concerns that are cleared: 1. NSS_NoDB_Init() does open user's cert DB and user modules. 2. NSS_NoDB_Init() doesn't keep file descriptors open. It tries to open /pkcs11.txt and /secmod.db which is a bug and filed: https://bugzilla.mozilla.org/show_bug.cgi?id=641052 However the above bug is not considered harmful. BUG=75834 TEST=None Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=78317

Patch Set 1 #

Patch Set 2 : cleanup] #

Total comments: 14

Patch Set 3 : fixed comments #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -47 lines) Patch
M base/nss_util.h View 1 2 1 chunk +23 lines, -0 lines 3 comments Download
M base/nss_util.cc View 1 2 5 chunks +73 lines, -47 lines 3 comments Download
M chrome/renderer/render_process_impl.cc View 1 2 2 chunks +12 lines, -0 lines 0 comments Download
M content/browser/zygote_host_linux.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/zygote_main_linux.cc View 1 2 3 chunks +16 lines, -0 lines 1 comment Download

Messages

Total messages: 4 (0 generated)
Alpha Left Google
9 years, 9 months ago (2011-03-11 23:59:27 UTC) #1
wtc
hclam: thank you for making this work. Here are my review comments. High-Level Comments: 1. ...
9 years, 9 months ago (2011-03-15 00:21:45 UTC) #2
Alpha Left Google
Thanks for reviewing. Here's the patch to address your comments. To answer your higher level ...
9 years, 9 months ago (2011-03-15 01:27:51 UTC) #3
wtc
9 years, 9 months ago (2011-03-15 21:37:20 UTC) #4
LGTM.

Thank you for explaining the motivation for omitting so
much code in the NoDB mode (to match how we initialize NSS
on Mac and Windows).  I have a suggested change related to
that below, at base/nss_util.h:46.

http://codereview.chromium.org/6684018/diff/7002/base/nss_util.cc
File base/nss_util.cc (right):

http://codereview.chromium.org/6684018/diff/7002/base/nss_util.cc#newcode207
base/nss_util.cc:207: // This method is used to force NSS to ne initialized
without a DB.
Typo: ne => be

http://codereview.chromium.org/6684018/diff/7002/base/nss_util.cc#newcode306
base/nss_util.cc:306: root_ = InitDefaultRootCerts();
This function and PKCS11PasswordFunc at line 292 above
aren't defined for the !defined(USE_NSS) case.

http://codereview.chromium.org/6684018/diff/7002/base/nss_util.cc#newcode366
base/nss_util.cc:366: bool NSSInitSingleton::force_nodb_init_ = false;
Nit: add a comment:
// static
before this line.

http://codereview.chromium.org/6684018/diff/7002/base/nss_util.h
File base/nss_util.h (right):

http://codereview.chromium.org/6684018/diff/7002/base/nss_util.h#newcode42
base/nss_util.h:42: // persistent DB is prohibited.
Please document that this function is applicable to the
USE_NSS case only.  On Mac and Windows, NSS is always
initialized without a persistent DB.

http://codereview.chromium.org/6684018/diff/7002/base/nss_util.h#newcode46
base/nss_util.h:46: // loaded manually after NSS initialization.
I still think omitting the InitDefaultRootCerts call
is a non-obvious side effect of ForceNSSNoDBInit().

If you really do not want to load the default root certs
on Linux, it may be better to add a DisableDefaultRootCerts
function.

http://codereview.chromium.org/6684018/diff/7002/base/nss_util.h#newcode54
base/nss_util.h:54: // NSS is fork-sensitive to avoid problems when using user
security modules in
Nit: what does "fork-sensitive" mean?  Please reword this
comment.

http://codereview.chromium.org/6684018/diff/7002/content/browser/zygote_main_...
File content/browser/zygote_main_linux.cc (right):

http://codereview.chromium.org/6684018/diff/7002/content/browser/zygote_main_...
content/browser/zygote_main_linux.cc:24: #include "base/base64.h"
Nit: why does the new code need "base/base64.h"?

Powered by Google App Engine
This is Rietveld 408576698