Commit Graph

96 Commits

Author SHA1 Message Date
Chris Peterson
677bf4030c Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe
2017-11-05 19:37:28 -08:00
David Keeler
651b363b86 bug 1424392 - remove unnecessary nsINSSComponent usage in nsNSSCallbacks r=mgoodwin
PK11PasswordPromptRunnable::RunOnTargetThread instantiates nsINSSComponent and
calls GetPIPNSSBundleString/PIPBundleFormatStringFromName to get some localized
strings. Since that runs on the main thread, we can call the helpers in
nsNSSCertHelper instead.

MozReview-Commit-ID: GsHoGDKBKdB
2017-12-08 14:07:04 -08:00
Andrea Marchesini
4cdec3b5e8 Bug 1424809 - Get rid of NS_NewPostDataStream, r=valentin 2017-12-12 06:01:17 -06:00
David Keeler
c874075692 bug 1424085 - add owning handles so cert references don't leak in IsCertificateDistrustImminent r=jcj
nsIX509Cert::GetCert() returns a CERTCertificate whose reference count has
already been increased. Before this patch, when IsCertificateDistrustImminent
called CertDNIsInList(rootCert->GetCert(), RootSymantecDNs) and
CertDNIsInList(aCert->GetCert(), RootAppleAndGoogleDNs), the reference count on
those certificates would never get a corresponding decrement, so we would keep
those certificates alive until shut down. A reasonable and consistent solution
is to introduce a UniqueCERTCertificate handle in each case to own the
reference.

The status of this fix can be verified by setting MOZ_LOG="pipnss:4", running
Firefox, connecting to any host, and then shutting down. If an NSS resource
reference has been leaked, "[Main Thread]: E/pipnss NSS SHUTDOWN FAILURE" will
be in the console output. Otherwise,
"[Main Thread]: D/pipnss NSS shutdown =====>> OK <<=====" will be in the console
output.

This patch also removes nsIX509CertList::DeleteCert because it would also leak a
reference. Luckily, nothing was using it.

This patch also clarifies the implementation of nsIX509CertList::AddCert by
making the ownership transfers explicit.

MozReview-Commit-ID: 2qHo3DmhTPz
2017-12-07 15:08:43 -08:00
Tristan Bourvon
01cf3d8a39 Bug 1412646 - Initialize some uninitialized fields in security/manager/ r=keeler
MozReview-Commit-ID: HGj8xw5Uq6j
2017-10-31 11:04:40 +01:00
J.C. Jones
f263a78289 Bug 1409259 - Add a console warning for soon-to-be-distrusted roots r=keeler,ttaubert
This patch adds a new diagnostic status flag to nsIWebProgressListener,
STATE_CERT_DISTRUST_IMMINENT, which indicates that the certificate chain is
going to change validity due to an upcoming distrust event. The first of
these events is this bug, affecting various roots from Symantec.

The STATE_CERT_DISTRUST_IMMINENT flag is set by nsNSSCallbacks and passed,
via nsSecureBrowserUIImpl, to browser.js where it is used to alert the console.

Adding this sort of diagnostic printing to be accessible to browser.js is a
long-desired goal, as future functionality can start doing more decision-making
there. We may, for example, also want to degrade the lock icon, which will be
straightforward with this flag.

This commit does not implement the IsCertificateDistrustImminent method. That is
follow-on work.

MozReview-Commit-ID: 75IOdc24XIV
2017-10-18 22:29:42 -07:00
David Keeler
f50044dd9d bug 1357815 - 1/4: move VerifyCMSDetachedSignatureIncludingCertificate to where it's used r=jcj
MozReview-Commit-ID: JsBPGhDxQoS
2017-10-24 13:18:14 -07:00
Mark Goodwin
15a3f45db3 Bug 1406856 - Re-plumb nsISSLStatus.idl to carry with it the whole nsIX509CertList r=jcj,keeler
MozReview-Commit-ID: 2YDmCzqdm26
2017-10-26 17:52:11 +01:00
Sebastian Hengst
79a4e6d228 Backed out changeset 51eaba841505 (bug 1406856) for failing eslint at security/manager/ssl/tests/unit/head_psm.js:732:53 | Multiple spaces found before '='. r=backout 2017-10-28 12:49:09 +02:00
Mark Goodwin
2f1de4d489 Bug 1406856 - Re-plumb nsISSLStatus.idl to carry with it the whole nsIX509CertList r=keeler
MozReview-Commit-ID: 2YDmCzqdm26
2017-10-26 17:52:11 +01:00
David Keeler
e53b8eabd4 bug 1400913 - back out the functionality changes from bug 1364159 (but keep the test) r=jcj
Bug 1364159 introduced an optimization that attempted to avoid reading from the
user's cached certificate database as much as possible when building a verified
certificate chain. Unfortunately this had the side-effect of not preferring root
certificates in path building, which can result in unnecessarily long chains
(which rather defeats the purpose, since it means more signature verifications).
This patch reverts the functionality changes from that bug but keeps the test
that was added (the test didn't directly test the functionality changes - it's
more of a check that path building will query the cached certificate db when
necessary).

MozReview-Commit-ID: I56THTLUytH
2017-09-18 10:28:58 -07:00
Matthew Noorenberghe
aa0b100f59 Bug 306730 - Do not include the token name in prompts for the internal key slot. r=keeler
MozReview-Commit-ID: 3TPZrTQxQC5
2017-09-12 14:42:19 -07:00
Franziskus Kiefer
4b920b23df Bug 1397833 - don't assert on custom TLS key-exchange groups, r=keeler
MozReview-Commit-ID: 8oztPlzw3PB
2017-09-08 11:53:11 +02:00
Franziskus Kiefer
26f5b161a3 Bug 1396463 - add ssl_sig_rsa_pkcs1_sha1md5 case to getSignatureName, r=bustage
MozReview-Commit-ID: 1SxJjt41NOj
2017-09-04 15:24:03 +02:00
Franziskus Kiefer
081791aac5 Bug 1396463 - add ssl_sig_rsa_pkcs1_sha1 case to getSignatureName, r=bustage
MozReview-Commit-ID: 814ZXGoesQz
2017-09-04 10:57:38 +02:00
Franziskus Kiefer
1111350822 Bug 1304923 - adding key exchange group and signature scheme details to devtools view, r=keeler, Honza
This patch adds the group used for TLS key exchange and the siganture scheme of the certificate to SSLStatus and displays it in devtools.

MozReview-Commit-ID: 7aTj0U5GIvo
2017-08-28 15:29:19 +02:00
Nicholas Nethercote
d24ecfe191 Bug 1387381 - Remove nsXPIDLString local variables. r=erahm.
nsXPIDLStrings are marked as VOIDED upon initialization. Most of these local
nsXPIDLString variables are immediately set via getter_Copies(), which will
either assign a string value (using Adopt()) or do SetIsVoid(). These can be
trivially converted to nsString, which will get the same treatment.

The patch suitably converts the remaining nsXPIDLString local variable as well.
2017-08-08 16:07:55 +10:00
Andrea Marchesini
9e8ae1dfd0 Bug 1350958 - Finish labeling ProxyReleaseEvent, r=billm 2017-07-14 08:49:22 +02:00
Sylvestre Ledru
9d4a84d778 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG
2017-07-06 14:00:35 +02:00
Bill McCloskey
ce42826bdf Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book
238bf154d5 Backed out changeset 4f6302a98ae4 (bug 1372405) 2017-06-21 13:59:26 +02:00
Bill McCloskey
67e8af4720 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book
bbe9441993 Backed out changeset 9846de3bd954 (bug 1372405) 2017-06-20 08:27:02 +02:00
Bill McCloskey
f69608368b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Bevis Tseng
e6dc9e02bc Bug 1372453 - Part 2: Name the caller of ProxyReleaseEvent. r=billm
MozReview-Commit-ID: LYhSWnZkq0i
2017-06-14 09:27:17 +08:00
Cykesiopka
916e07dbb0 Bug 1368107 - Remove TransportSecurityInfo::GetHostNameRaw(). r=keeler
GetHostNameRaw() returns a char* string, which is less safe and ergonomic
compared to the Mozilla string classes. GetHostName() can be used instead.

MozReview-Commit-ID: GYvTnISNN35
2017-06-03 13:35:51 +08:00
David Keeler
91fd4bf7e6 bug 1364159 - potentially avoid calling CERT_CreateSubjectCertList in NSSCertDBTrustDomain::FindIssuer r=Cykesiopka,jcj
CERT_CreateSubjectCertList is not an inexpensive function call, since it
enumerates the certificate database (i.e. reads from disk a lot). If we're
verifying for a TLS handshake, however, we should already have in memory a
certificate chain sent by the peer (there are some cases where we won't, such as
session resumption (see bug 731478)). If we can, we should use those
certificates before falling back to calling CERT_CreateSubjectCertList.

MozReview-Commit-ID: ASjVGsELb1O
2017-05-11 16:41:12 -07:00
Cykesiopka
16c5e5a31f Bug 1342737 - Avoid using nsCRT.h and nsCRTGlue.h in PSM. r=keeler
There are a few places where we can use the safer functionality provided by the
Mozilla string classes instead.

Also fixes Bug 1268657 (remove vestigial
TransportSecurityInfo::SetShortSecurityDescription declaration).

MozReview-Commit-ID: Cxv5B4bsDua
2017-03-28 22:57:15 +08:00
David Keeler
d28657c143 bug 1348713 - ensure CT information is set in the case of session resumption r=jcj
MozReview-Commit-ID: 7fLnMu9f1kC
2017-03-20 17:10:33 -07:00
Cykesiopka
1287b2c0bb Bug 1310127 - Part 10: Handle netwerk/protocol/http MOZ_MUST_USE functions in PSM. r=wcpan
The only unhandled call updates nsHTTPListener::mHttpResponseContentType, but
nothing actually uses the value of mHttpResponseContentType.

MozReview-Commit-ID: FQXESvoO2ZN
2016-12-28 16:25:22 +08:00
Wes Kocher
64ccd9559b Merge inbound to m-c a=merge
MozReview-Commit-ID: DCUf7VEDrTt
2017-02-17 13:38:51 -08:00
Vedant Sareen
a85a2ad339 Bug 1330907 - Rename Telemetry::ID to Telemetry::HistogramID. r=dexter
Changed |print("enum ID : uint32_t {", file=output)| to |print("enum HistogramID : uint32_t {", file=output)| at line 53 of the file |toolkit/components/telemetry/gen-histogram-enum.py|, and then replaced all the textual occurrences of |Telemetry::ID| to |Telemetry::HistogramID| and |ID| to |HistogramID| in 43 other files.
2017-02-16 00:45:15 +05:30
Tom Tromey
a4b717ab39 Bug 1060419 - make log_print use Printf.h, r=froydnj
MozReview-Commit-ID: BIZ1GQEZ1vs
2016-12-15 20:16:31 -07:00
Cykesiopka
1930021909 Bug 1330365 - Use mozilla::TimeStamp instead of NSPR's PRIntervalTime for OCSP timeout code. r=keeler
mozilla::TimeStamp is generally superior to PRIntervalTime, and switching lets
us get rid of yet another NSPR dependency.

This patch also:
 1. Gets rid of code in nsNSSHttpRequestSession::createFcn() that limits the
    max OCSP timeout. This is a relic from when NSS was used for OCSP requests,
    and is no longer necessary.
 2. Converts all uses of PR_NOT_REACHED() to MFBT asserts while we're nearby.

MozReview-Commit-ID: KvgOWWhP8Km
2017-01-14 13:12:43 +08:00
Andrea Marchesini
46a9207d60 Bug 1328653 - Merging all the various *OriginAttributes to just one, r=huseby 2017-01-12 17:38:48 +01:00
Nathan Froyd
e6d501d371 Bug 1329984 - use a strong reference for nsHTTPDownloadEvent::mRequestSession; r=keeler
This change eliminates some manual addref/release management and also
makes the ownership model clearer.
2017-01-10 16:36:03 -05:00
Cykesiopka
2ea082a548 Bug 1325107 - Stop using NS_ASSERTION() in PSM. r=mgoodwin
MOZ_ASSERT() is basically equivalent to NS_ASSERTION().
PSM already uses MOZ_ASSERT() for new code, so there's no need to use
NS_ASSERTION() as well.

MozReview-Commit-ID: JHDsbDkYvHf
2017-01-02 14:11:39 +08:00
Masatoshi Kimura
bc7cc7c96e Bug 1321909 - Remove the "security.ssl.false_start.require-npn" pref. r=keeler
MozReview-Commit-ID: 1RQlxQb2IJJ
2016-12-03 10:04:49 +09:00
Masatoshi Kimura
7588e8a167 Bug 1130670 - Remove vestigial RC4 fallback backend. r=keeler
MozReview-Commit-ID: 9YRVgnymndI
2016-12-02 22:09:38 +09:00
Jonathan Hao
c8d995ab01 Bug 1315143 - Make OCSP use Origin Attribute framework (PSM). r=Cykesiopka,keeler 2016-11-14 18:26:15 +08:00
Carsten "Tomcat" Book
016b5ef571 Backed out changeset 81a11a25d25d (bug 1315143) 2016-11-14 12:52:16 +01:00
Jonathan Hao
c0f6a74c60 Bug 1315143 - Make OCSP use Origin Attribute framework (PSM). r=mayhemer 2016-11-14 18:26:15 +08:00
Jonathan Hao
1e50a2af78 Bug 1312794 - Annotate OCSP requests by first party domain. (adapted from Tor Browser patch #13670) r=keeler 2016-11-03 17:53:52 +08:00
David Keeler
0bb9a095aa bug 1313491 - include more context when determining EV status r=Cykesiopka,jcj,mgoodwin
When doing TLS session resumption, the AuthCertificate hook is bypassed, which
means that the front-end doesn't know whether or not to show the EV indicator.
To deal with this, the platform attempts an EV verification. Before this patch,
this verification lacked much of the original context (e.g. stapled OCSP
responses, SCTs, the hostname, and in particular the first-party origin key).
Furthermore, it was unclear from a code architecture standpoint that a full
verification was even occurring. This patch brings the necessary context to the
verification and makes it much more clear that it is happening. It also takes
the opportunity to remove some unnecessary EV-related fields and information in
code and data structures that don't require it.

MozReview-Commit-ID: LTmZU4Z1YXL
2016-10-31 17:02:57 -07:00
Jan de Mooij
418dfe2cf2 Bug 1311996 - Fix code using pkix::Result to not conflict with the new mozilla::Result type. r=keeler 2016-10-31 10:05:13 +01:00
Masatoshi Kimura
d07f34e0d0 Bug 1305561 - Do not check renego extension when TLS version is 1.3. r=keeler
MozReview-Commit-ID: JtT6hLcbl3W
2016-09-27 20:06:22 +09:00
EKR
16f134d58b Bug 1304919 - PSM changes to support TLS 1.3 key exchange, r=mt
MozReview-Commit-ID: 1GMk8PajbHj
2016-09-23 14:27:29 +10:00
Sebastian Hengst
0b50b28d38 Backed out changeset b54d608edfa8 (bug 1304919) 2016-09-24 18:00:17 +02:00
EKR
932d43a9f5 Bug 1304919 - PSM changes to support TLS 1.3 key exchange, r=mt
MozReview-Commit-ID: 1GMk8PajbHj
2016-09-23 14:27:29 +10:00
Ryan VanderMeulen
65e0550627 Merge m-c to inbound. a=merge 2016-08-24 09:09:05 -04:00