Commit Graph

3390 Commits

Author SHA1 Message Date
Nicholas Nethercote
8964637d70 Bug 1182959 (part 1) - Use nsTHashtable::Iterator in CertBlockList. r=honzab. 2015-07-20 17:12:03 -07:00
Jed Davis
4f7c3a8066 Bug 1181704 - Use chromium SafeSPrintf for sandbox logging. r=gdestuynder r=glandium
This gives us a logging macro that's safe to use in async signal context
(cf. bug 1046210, where we needed this and didn't have it).

This patch also changes one of the format strings to work with
SafeSPrintf's format string dialect; upstream would probably take a
patch to handle those letters, but this is easier.
2015-07-09 12:09:00 +02:00
Jed Davis
bad4183e1d Bug 1181704 - Import chromium SafeSPrintf. r=bobowen
This also imports the unit tests but doesn't arrange to run them.
Including the tests in our xul-gtest is possible but not trivial: there
are logging dependencies, and they use a different #include path for
gtest.h (which we'd need to patch).

Upstream revision: df7cc6c04725630dd4460f29d858a77507343b24.
2015-07-09 12:04:00 +02:00
David Keeler
7ac0d92807 bug 1178988 - GenerateOCSPResponse: load certs/keys in two phases r=Cykesiopka
This was initially done to work around a readdir-related bug in the B2G ICS
emulator, but then it turned out that test_ocsp_url.js still fails in ways that
are unreproducible outside of mozilla-inbound on that platform, so it was
disabled (r=sworkman). It's still a good idea, though, to avoid any potential
future issues with readdir not being reentrant.
2015-07-15 14:12:02 -07:00
David Keeler
359bd103d4 bug 1178988 - convert test_ocsp_url to generate certificates at build time r=Cykesiopka
Also enable loading of certificates and private keys into GenerateOCSPResponse
2015-06-04 17:03:48 -07:00
David Keeler
893b8954ec bug 1178988 - refactor key-specific parts of pycert.py into pykey.py r=Cykesiopka,mgoodwin 2015-06-30 14:35:42 -07:00
Ryan VanderMeulen
2a13b2456b Merge m-c to inbound. a=merge 2015-07-19 22:38:28 -04:00
Benjamin Peterson
0dd708e3a8 no bug - fix typo and grammar in comment r=me DONTBUILD 2015-07-19 18:07:43 -07:00
ffxbld
c56f7fab6d No bug, Automated HPKP preload list update from host bld-linux64-spot-135 - a=hpkp-update 2015-07-18 03:35:51 -07:00
ffxbld
a53fa199eb No bug, Automated HSTS preload list update from host bld-linux64-spot-135 - a=hsts-update 2015-07-18 03:35:49 -07:00
Mark Goodwin
8b0c418e25 Bug 1183822 - Add an OCSP test for signers with SHA-1 certificates (r=keeler) 2015-07-17 17:07:50 +01:00
Mark Goodwin
2e80867ccc Bug 1183822 - fix OCSP verification failures (r=keeler)
Adds a new TrustDomain for OCSP Signers which will always allow all acceptible
signature digest algorithms. Calls to most other TrustDomain methods are passed
through to the owning NSSCertDBTrustDomain.
2015-07-17 17:07:48 +01:00
Mark Goodwin
46b7226fea Bug 1183065 - Add logging on OneCRL revocation checks (r=Cykesiopka) 2015-07-17 17:07:47 +01:00
Wes Kocher
6216b9587e Backed out 3 changesets (bug 1178988) for ocsp orange CLOSED TREE
Backed out changeset 7fb6a9114916 (bug 1178988)
Backed out changeset 2700ec4adc3e (bug 1178988)
Backed out changeset 07b9c2331ac1 (bug 1178988)
2015-07-17 17:49:46 -07:00
Mark Goodwin
10d4e93718 Backed out changeset ec1b5a7d05e9 (bug 1183065) 2015-07-17 10:37:00 +01:00
Mark Goodwin
adead3a8a3 Backed out changeset fb6cbb4ada54 (bug 1183822) 2015-07-17 10:36:58 +01:00
Mark Goodwin
57cd103b84 Backed out changeset f324dcfaab40 (bug 1183822) 2015-07-17 10:36:56 +01:00
Mark Goodwin
8605e4aed2 Bug 1183822 - Add an OCSP test for signers with SHA-1 certificates (r=keeler) 2015-07-17 10:04:17 +01:00
Mark Goodwin
80b97ddffc Bug 1183822 - fix OCSP verification failures (r=keeler)
Adds a new TrustDomain for OCSP Signers which will always allow all acceptible
signature digest algorithms. Calls to most other TrustDomain methods are passed
through to the owning NSSCertDBTrustDomain.
2015-07-17 10:03:56 +01:00
Mark Goodwin
00edef09b4 Bug 1183065 - Add logging on OneCRL revocation checks (r=Cykesiopka) 2015-07-17 10:03:21 +01:00
David Keeler
b27333093c bug 1178988 - work around PR_ReadDir bug on B2G ICS emulator by loading certs/keys in two phases r=Cykesiopka 2015-07-15 14:12:02 -07:00
David Keeler
e54426e7bc bug 1178988 - convert test_ocsp_url to generate certificates at build time r=Cykesiopka
Also enable loading of certificates and private keys into GenerateOCSPResponse
2015-06-04 17:03:48 -07:00
David Keeler
998a66c12a bug 1178988 - refactor key-specific parts of pycert.py into pykey.py r=Cykesiopka,mgoodwin 2015-06-30 14:35:42 -07:00
Cykesiopka
a0279ce7ca Bug 1179678 - Add result strings to misc PSM xpcshell tests. r=keeler 2015-07-14 23:19:00 +02:00
Wes Kocher
3ce60d2f05 Backed out 2 changesets (bug 1181704) for static build bustage CLOSED TREE
Backed out changeset fbf7aca43c3a (bug 1181704)
Backed out changeset 8864c0587ced (bug 1181704)
2015-07-13 16:51:17 -07:00
Jed Davis
2f2012818b Bug 1181704 - Use chromium SafeSPrintf for sandbox logging. r=kang r=glandium
This gives us a logging macro that's safe to use in async signal context
(cf. bug 1046210, where we needed this and didn't have it).

This patch also changes one of the format strings to work with
SafeSPrintf's format string dialect; upstream would probably take a
patch to handle those letters, but this is easier.
2015-07-13 16:17:58 -07:00
Jed Davis
db8c6b5327 Bug 1181704 - Import chromium SafeSPrintf. r=bobowen
This does not include the upstream unit tests.  Including the tests
in our xul-gtest is possible but not trivial: there are logging
dependencies, and they use a different #include path for gtest.h (which
we'd need to patch).

Upstream revision: df7cc6c04725630dd4460f29d858a77507343b24.
2015-07-13 16:17:58 -07:00
Birunthan Mohanathas
e52329c788 Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Carsten "Tomcat" Book
108daa6a0d merge mozilla-inbound to mozilla-central a=merge 2015-07-13 11:51:14 +02:00
ffxbld
6a03db2cc6 No bug, Automated HPKP preload list update from host bld-linux64-spot-222 - a=hpkp-update 2015-07-11 03:33:38 -07:00
ffxbld
5802404a13 No bug, Automated HSTS preload list update from host bld-linux64-spot-222 - a=hsts-update 2015-07-11 03:33:36 -07:00
David Keeler
2c108fdd54 bug 1181376 - convert test_bug480619.html to an xpcshell test r=mgoodwin 2015-07-07 16:09:56 -07:00
Geoff Brown
495b7cbfe1 Bug 1026290 - Update mochitest-chrome manifests for android; r=jgriffin 2015-07-10 14:41:59 -06:00
Mark Goodwin
2845785c4e Bug 1159155 - Add telemetry probe for SHA-1 usage - some tests (r=keeler) 2015-07-09 07:22:32 +01:00
Mark Goodwin
fc2d7be9e8 Bug 1159155 - Add telemetry probe for SHA-1 usage (r=keeler) 2015-07-09 07:22:29 +01:00
Phil Ringnalda
e96bb3a6ed Back out 2 changesets (bug 1178988) for b2g emulator opt xpcshell failure in test_ocsp_url.js
CLOSED TREE

Backed out changeset 2c5d5eb434b9 (bug 1178988)
Backed out changeset 936d991c4cbc (bug 1178988)
2015-07-08 22:49:12 -07:00
David Keeler
9e073d55c1 bug 1178988 - convert test_ocsp_url to generate certificates at build time r=Cykesiopka
Also enable loading of certificates and private keys into GenerateOCSPResponse
2015-06-04 17:03:48 -07:00
David Keeler
4f197a5c27 bug 1178988 - refactor key-specific parts of pycert.py into pykey.py r=Cykesiopka,mgoodwin 2015-06-30 14:35:42 -07:00
Carsten "Tomcat" Book
1fcc543445 Merge mozilla-central to fx-team 2015-07-08 12:04:53 +02:00
Steven Englehardt
2d95563bab Bug 1153010 - Disambiguate error messages for mixed content and weak/broken cipher. r=keeler,tanvi,dolske 2015-07-08 09:04:11 +02:00
Nicholas Nethercote
24ab7bcdca Bug 1179071 - Merge RemovingIterator into Iterator. r=froydnj.
The original motivation for the Iterator/RemovingIterator split was that
PLDHashTable Checker class would treat them differently. But that didn't end up
happening (see bug 1131308). So this patch merges them. This is a small code
size win now but it will become bigger when I add iterators to nsTHashTable and
nsBaseHashtable.

The only complication is that PLDHashTable::Iter() is now non-const, which is
a problem if you use it in a const method. So I added PLDHashTable::ConstIter()
which is used in just two places. It's a bit of a hack -- effectively a
const_cast -- but I don't think it's too bad.
2015-07-06 22:02:26 -07:00
Dragana Damjanovic
c7fc0a288e Bug 905127 - Part 2 - remove unnecessary nsNetUtil.h includes r=jduell 2015-07-06 07:55:00 +02:00
Emanuel Hoogeveen
31c0c961cd Bug 905127 - Part 1 - Make some functions from nsNetUtil not inline. r=jduell 2015-07-07 04:17:00 +02:00
David Keeler
cd364e6404 Backed out changeset 0e38e844e0af (bug 1178988) for breaking windows builds on a CLOSED TREE 2015-07-06 16:24:25 -07:00
David Keeler
a5f8e722e5 Backed out changeset aeae195846c8 (bug 1178988) for breaking windows builds 2015-07-06 16:22:48 -07:00
David Keeler
fc34536bb7 bug 1178988 - convert test_ocsp_url to generate certificates at build time r=Cykesiopka
Also enable loading of certificates and private keys into GenerateOCSPResponse
2015-06-04 17:03:48 -07:00
David Keeler
19ba26c5f5 bug 1178988 - refactor key-specific parts of pycert.py into pykey.py r=Cykesiopka,mgoodwin 2015-06-30 14:35:42 -07:00
Phil Ringnalda
7f435e44fe Merge m-i to m-c, a=merge 2015-07-04 11:07:23 -07:00
ffxbld
8eccd1e82b No bug, Automated HPKP preload list update from host bld-linux64-spot-384 - a=hpkp-update 2015-07-04 03:30:40 -07:00
ffxbld
f90ae9e8ea No bug, Automated HSTS preload list update from host bld-linux64-spot-384 - a=hsts-update 2015-07-04 03:30:37 -07:00
Juan Gomez
21d73728f3 Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-07-03 18:29:00 -07:00
Cykesiopka
dbc59edeed Bug 1174389 - Add result strings to PSM OCSP xpcshell tests. r=keeler 2015-07-02 00:45:00 +02:00
Andrew Bartlett
019c4e3337 bug 496234 - add test vectors from RFC 1320 for md4 implementation r=mayhemer 2015-06-25 12:10:40 -07:00
David Keeler
cd883f2839 bug 496234 - fix md4 implementation by appending the input length as a 64-bit number r=mayhemer 2015-06-25 12:32:44 -07:00
David Keeler
bc07da648e bug 496234 - use stdint types in md4 implementation r=mayhemer
Also removes some trailing whitespace.
2015-06-25 12:00:49 -07:00
Nicholas Nethercote
f656289759 Bug 1175807 - Remove PL_DHashTableEnumerate() uses from nsNSSShutdown. r=honzab.
The doPK11Logout() change is straightforward.

In contrast, the loop in evaporateAllNSSResources() is *weird*. Nevertheless,
this change preserves its behaviour.
2015-06-17 21:09:27 -07:00
Nathan Froyd
46d6f38e68 Bug 1161627 - part 2 - machine-convert TemporaryRef<T> to already_AddRefed<T>; r=ehsan
This conversion was done with the script:

  find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl' | \
    egrep -v 'cairo-win32-refptr.h|RefPtr.h|TestRefPtr.cpp' | \
    xargs sed -i -e 's/mozilla::TemporaryRef</already_AddRefed</g' \
                 -e 's/TemporaryRef</already_AddRefed</g'

Manual fixups were performed in the following instances:

- We handled mfbt/RefPtr.h manually so as to not convert TemporaryRef itself
  into already_AddRefed.

- The following files had explicit Move() calls added to make up for the lack
  of a copy constructor on already_AddRefed:

  dom/base/ImageEncoder.cpp
  dom/media/MediaTaskQueue.{h,cpp}
  dom/media/webaudio/PannerNode.cpp

- A redundant overload for MediaTaskQueue::Dispatch was deleted.

- A few manual fixups were required in mfbt/tests/TestRefPtr.cpp.

- Comments, using declarations, and forward declarations relating to
  TemporaryRef in dom/canvas/ and gfx/layers/ were changed to refer to
  already_AddRefed.
2015-06-17 10:00:52 -04:00
Cykesiopka
377e964bb9 Bug 1145679 - Part 2 - Tests. r=keeler 2015-06-29 22:19:00 +02:00
Cykesiopka
fcecab7191 Bug 1145679 - Reject EV status for end-entity EV certs with overly long validity periods. r=keeler 2015-06-29 22:19:00 +02:00
David Keeler
1c422f205e bug 1174292 - convert test_cert_version.js to generate certificates at build time r=Cykesiopka
Also remove redundant test-cases.
2015-06-12 14:56:07 -07:00
Carsten "Tomcat" Book
a1f11d0729 merge mozilla-inbound to mozilla-central a=merge 2015-06-29 14:17:02 +02:00
ffxbld
fd99eda623 No bug, Automated HPKP preload list update from host bld-linux64-spot-098 - a=hpkp-update 2015-06-27 03:33:49 -07:00
ffxbld
1888e4b962 No bug, Automated HSTS preload list update from host bld-linux64-spot-098 - a=hsts-update 2015-06-27 03:33:47 -07:00
Carsten "Tomcat" Book
135b0588cd merge mozilla-inbound to mozilla-central a=merge 2015-06-22 14:03:17 +02:00
Ryan VanderMeulen
1c2e2bc307 Bug 1029775 - Skip test_ocsp_stapling_expired.js on B2G debug for frequent intermittent failures. 2015-06-21 21:22:08 -04:00
ffxbld
564d742bac No bug, Automated HPKP preload list update from host bld-linux64-spot-224 - a=hpkp-update 2015-06-20 03:33:00 -07:00
ffxbld
6802ddd625 No bug, Automated HSTS preload list update from host bld-linux64-spot-224 - a=hsts-update 2015-06-20 03:32:58 -07:00
Ryan VanderMeulen
9506cf1179 Bug 1176097 - Update NSS to NSS_3_19_2_RTM. 2015-06-19 14:01:18 -04:00
Bob Owen
863b811c3b Bug 1177594: Use a USER_RESTRICTED token level on GMP process when integrity levels are available. r=cpearce 2015-06-26 14:19:12 +01:00
Ryan VanderMeulen
55b2086097 Backed out changeset 8b4e4083639e (bug 1171931) for B2G debug emulator bustage. 2015-06-25 19:48:42 -04:00
Bob Owen
7551c6fd42 Bug 1172388: Use a USER_RESTRICTED access level token on Windows 10. r=cpearce 2015-06-19 23:35:43 +01:00
Jed Davis
5ef6b7bea8 Bug 1176085 - Fix second/nanosecond confusion in Linux sandbox start error case. r=kang 2015-06-19 14:26:44 -07:00
Juan Gomez
98461fc4a4 Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-06-24 14:11:00 -04:00
Benoit Girard
fa09f0548c Bug 1172216 - Move nsStackwalk to mozglue. r=glandium 2015-06-10 16:32:45 -04:00
Bob Owen
c04ebe0b83 Bug 1165895: Add NPAPI sandbox rule for the crash server pipe and x64 Temp dir write access. r=bbondy 2015-06-18 12:01:38 +01:00
Masatoshi Kimura
6ca1dfe672 Bug 1165549 - Update fallback whitelist. r=keeler 2015-06-17 20:52:33 +09:00
David Keeler
8528e39216 bug 1173565 - convert test_pinning_dynamic.js to generate certificates at build time r=Cykesiopka
Also fixes up references to test_pinning_dynamic certificates in test_pinning_header_parsing.js
2015-06-09 10:35:47 -07:00
Cykesiopka
b81b757b1e Bug 1171820 - Convert test_bug483440.html mochitest to an xpcshell test. r=keeler 2015-06-13 00:51:00 +02:00
Birunthan Mohanathas
334f1e22e7 Bug 1164714 - Move netwerk/test/TestSTSParser.cpp into security/manager/ssl/tests/. r=keeler 2015-06-14 21:37:12 -07:00
David Keeler
2a50c02e15 bug 1172615 - check for and return early in the case of authentication bypass in AuthCertificateHook r=mcmanus 2015-06-08 13:18:23 -07:00
Jed Davis
98cf948a01 Bug 1168555 - Work around Nuwa not always being single-threaded when a normal content process is. r=kang 2015-06-10 13:38:00 -04:00
Kai Engert
6f9a988165 Bug 1174102 - Update to NSS 3.19.2, landing NSS_3_19_2_BETA1, r=nss-confcall 2015-06-12 11:10:17 +02:00
Cykesiopka
40dfab484a Bug 1171819 - Convert test_cert_eku-*.js to generate certificates at build time. r=keeler 2015-06-10 22:50:00 +02:00
Mike Perry
bc766df83c Bug 629558 - Pref to make Intermediate Cert Store memory-only. r=keeler 2015-06-10 14:14:00 +02:00
Atul Kumar
6e6d6a989d Bug 1136301 - Null check for mCert->slot added in destructorSafeDestroyNSSReference & MarkForPermDeletion. Formatting update in MarkForPermDeletion. r=keeler 2015-06-10 09:46:16 -07:00
David Keeler
a5ab4c5ab5 bug 1170303 - treat malformed name information in certificates as a domain name mismatch r=Cykesiopka 2015-06-01 13:55:23 -07:00
David Keeler
e41d9fdb07 bug 1171557 - make test_cert_trust.js certs a bit more realistic r=mgoodwin
According to the Baseline Requirements, root certificates MUST NOT
have the extendedKeyUsage extension. The extension is optional for
intermediates and required for end-entity certificates. This change
modifies the test certificates so they're more in line with the BRs.
2015-06-03 15:37:38 -07:00
David Keeler
848778789e bug 1171557 - convert test_cert_trust.js to generate certificates at build time r=mgoodwin 2015-06-03 15:12:00 -07:00
Eric Rahm
a30b6503c6 Bug 1145893 - Shutdown nsNSSComponent background threads during xpcom-shutdown. r=keeler, a=me 2015-03-23 10:58:25 -07:00
Richard Barnes
89e603eaa6 Bug 1010068 - Disable OCSP for DV certificates in Firefox for Android r=keeler 2015-05-28 13:29:13 -07:00
Ryan VanderMeulen
a79144fc40 Backed out changeset fda85020d842 (bug 1010068) for Android test_cert_overrides.js failures.
CLOSED TREE
2015-06-08 11:37:33 -04:00
Richard Barnes
6b65fec02a Bug 1010068 - Disable OCSP for DV certificates in Firefox for Android r=keeler 2015-05-28 13:29:13 -07:00
Carsten "Tomcat" Book
48583b4851 merge mozilla-inbound to mozilla-central a=merge 2015-06-08 11:55:30 +02:00
ffxbld
a8e18e32a0 No bug, Automated HPKP preload list update from host bld-linux64-spot-1061 - a=hpkp-update 2015-06-06 03:26:59 -07:00
ffxbld
e2ae16611e No bug, Automated HSTS preload list update from host bld-linux64-spot-1061 - a=hsts-update 2015-06-06 03:26:57 -07:00
Jed Davis
3bde26970c Bug 1055310 - Step 3: Move syscall interceptions into SandboxFilter.cpp. r=kang
We can now keep the part of the policy implemented by upcalls to
userspace in the same place as the part of the policy that's handled
entirely in the kernel.  This will become more useful in the future
(e.g., bug 930258).
2015-06-05 15:17:40 -07:00
Jed Davis
9baf0005f4 Bug 1055310 - Step 2: Move SIGSYS handling to Chromium TrapRegistry. r=kang
This is more complicated than I'd like it to be, because we don't have
a good way to combine a specific trap function's knowledge that we want
to get a crash dump with the SIGSYS handler's copy of the unprocessed
signal info (which breakpad wants).  The bpf_dsl interface requires a
specific trap function type (via the TrapRegistry superclass), so even
if we implement our own registry we can't change what's passed to it.
Normally we could use thread-local storage to get around that, but it's
not async signal safe.

As a result there is an imperfect compromise: the trap function returns
a failure with ENOSYS, Chromium's SIGSYS handler writes it into the
context, our SIGSYS handler reads it back out and uses a copy of
the original signal context for the crash dump.  Other error codes
(and returning ENOSYS via the seccomp-bpf policy itself) are handled
normally.
2015-06-05 15:17:35 -07:00
Jed Davis
06da80b656 Bug 1055310 - Step 1: Convert seccomp-bpf policies to Chromium PolicyCompiler. r=kang
This completely rewrites SandboxFilter.cpp and removes SandboxAssembler.
System calls are now loosely grouped by what they do, now that order
doesn't matter, and most of the intersection the content and media
plugin whitelists is moved into a common superclass.  Hopefully this
improves the readability and comprehensibility of the syscall policies.

Also, the macros that take the syscall name are gone, because a plain
case label usually suffices now (the CASES_FOR_thing macros are a little
unsightly, but they're relatively simple), and at one point we saw
strange macro expansion issues with system header files that #define'd
some syscall names.

The signal handling is not migrated yet, so Trap() actions can't be used
yet; the next patch will take care of that, and to keep the intermediate
state working there's a minimal shim.

Bonus fix: non-const global variables use the "g" prefix; "s" is for
static class members and static variables in a function (where the
default is to allocate a separate copy per instance/activation).
2015-06-05 15:17:32 -07:00
David Keeler
dc258334a5 bug 969985 - cleanup of test_certificate_usages.js - see the rest of this commit message r=mgoodwin
Converts test_certificate_usages.js to generate certificates at build time.
Also does miscellaneous cleanup to use modern JS practices.
Since the test_cert_eku-* suite of tests covers the extended key usage extension,
removes superfluous testcases involving EKU.
Finally, renames test_certificate_usages.js to test_cert_keyUsage.js for a more
consistent naming scheme.
2015-06-02 10:58:59 -07:00
Eric Rahm
29f00ac208 Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj
This is straightforward mapping of PR_LOG levels to their LogLevel
counterparts:
  PR_LOG_ERROR   -> LogLevel::Error
  PR_LOG_WARNING -> LogLevel::Warning
  PR_LOG_WARN    -> LogLevel::Warning
  PR_LOG_INFO    -> LogLevel::Info
  PR_LOG_DEBUG   -> LogLevel::Debug
  PR_LOG_NOTICE  -> LogLevel::Debug
  PR_LOG_VERBOSE -> LogLevel::Verbose

Instances of PRLogModuleLevel were mapped to a fully qualified
mozilla::LogLevel, instances of PR_LOG levels in #defines were mapped to a
fully qualified mozilla::LogLevel::* level, and all other instances were
mapped to us a shorter format of LogLevel::*.

Bustage for usage of the non-fully qualified LogLevel were fixed by adding
|using mozilla::LogLevel;| where appropriate.
2015-06-03 15:25:57 -07:00