Граф коммитов

124 Коммитов

Автор SHA1 Сообщение Дата
Yoshi Huang 10b437080c Bug 1260931 - Part 3: Propagate firstPartyDomain. r=smaug 2016-09-06 10:25:58 +08:00
Yoshi Huang 85a594681d Bug 1260931 - Part 1: add firstPartyDomain. r=smaug
Add an origin attribute called 'firstPartyDomain'.
This value will be extracted from the URL bar.

And the purpose of this attribute is used to isolate the data-jars.
Please see the tor documentation.
https://www.torproject.org/projects/torbrowser/design/#identifier-linkability

The idea is like a superset of 'reject third party cookies', but not
only apply for cookies, it also applies to all data-jars like localStorage,
indexedDB and so on.

So basically an iframe will have its own data-jar, and this data-jar is
isolated by the URL from URL bar, for instance, an iframe
https://facebook.com inside https://cnn.com won't share data-jar with
the iframe (https://facebook.com) in https://bbc.com
2016-09-06 10:25:48 +08:00
Sebastian Hengst 60d03b201e Backed out changeset 935ffd53f193 (bug 1260931) for failing xpcshell test test_packaged_app_service.js. r=backout 2016-09-05 21:16:10 +02:00
Sebastian Hengst c9519f7c29 Backed out changeset b9afda2804fd (bug 1260931) 2016-09-05 21:15:29 +02:00
Yoshi Huang 6cca1d0c54 Bug 1260931 - Part 3: Propagate firstPartyDomain. r=smaug 2016-09-06 01:50:30 +08:00
Yoshi Huang 6c3b62e2fb Bug 1260931 - Part 1: add firstPartyDomain. r=smaug
Add an origin attribute called 'firstPartyDomain'.
This value will be extracted from the URL bar.

And the purpose of this attribute is used to isolate the data-jars.
Please see the tor documentation.
https://www.torproject.org/projects/torbrowser/design/#identifier-linkability

The idea is like a superset of 'reject third party cookies', but not
only apply for cookies, it also applies to all data-jars like localStorage,
indexedDB and so on.

So basically an iframe will have its own data-jar, and this data-jar is
isolated by the URL from URL bar, for instance, an iframe
https://facebook.com inside https://cnn.com won't share data-jar with
the iframe (https://facebook.com) in https://bbc.com
2016-09-06 01:50:15 +08:00
Yoshi Huang 69ed1a79e4 Bug 1244340 - Part 2: add setOriginAttributes in nsIXMLHttpRequest. r=sicking
Add a ChromeOnly method called 'setOriginAttributes' on the XMLHttpRequest,
so that we can override the origin attributes for those XHRs running by XUL
(which will use System Principal).
2016-08-26 18:59:00 +08:00
Rob Wu 9069fff35f Bug 1197451 - Add clipboardWrite permission r=billm
MozReview-Commit-ID: 6d1mQSVWRPe

--HG--
extra : rebase_source : 2f19bab5c9d6db25c60b2b19c06c7027384a04ca
2016-07-08 17:19:17 -07:00
James Andreou 3585e16752 Bug 1283281 - Remove PB Flag from DOMStorage. r=jdm 2016-06-29 14:01:00 +02:00
James Andreou 1d32e86b9c Bug 1269361 - Add mPrivateBrowsingId to OriginAttributes r=ehsan,jdm 2016-06-02 17:03:11 -04:00
Chris Peterson e343bcae34 Bug 1274415 - Fix -Wshadow warnings in caps/ directory. r=dveditz
caps/BasePrincipal.cpp:562:28 [-Wshadow] declaration shadows a local variable
caps/nsScriptSecurityManager.cpp:675:18 [-Wshadow] declaration shadows a local variable
caps/nsScriptSecurityManager.cpp:854:14 [-Wshadow] declaration shadows a local variable
2016-05-19 01:04:46 -07:00
Yoshi Huang ba1bb72568 Bug 1263496 - Part 3: fix for nsNullPrincipal::Create
This fixed the locations listed by
http://searchfox.org/mozilla-central/search?q=nsNullPrincipal::Create(&redirect=true
that needs to inherit origin attributes.
2016-04-27 18:38:07 +08:00
Kris Maglione 6d36833e42 Bug 1254194: Apply a content security policy to all WebExtension documents. r=gabor
MozReview-Commit-ID: HsFFbWdq00b

--HG--
extra : rebase_source : 07e4b6ec8c32f696d5b5987091ffc5ebde2c3061
extra : histedit_source : 20983fe6a9590d7f410276fac248c3d2f711caaa
2016-04-23 20:56:56 -07:00
J. Ryan Stinnett 2a55d065b7 Bug 1238160 - Rename OriginAttributes.mInBrowser and associated methods. r=bz,mayhemer
This change renames OriginAttributes.mInBrowser to mInIsolatedMozBrowser and
nsIPrincipal::GetIsInBrowserElement to GetIsInIsolatedMozBrowserElement.  Other
methods that pass these values around also have name changes.

Tokens such as "inBrowser" have previously been serialized into cache keys, used
as DB column names, stored in app registries, etc.  No changes are made to any
serialization formats.  Only runtime method and variable names are updated.

No behavior changes are made in this patch, so some renamed methods may have
nonsensical implementations.  These are corrected in subsequent patches
focused on behavior.

MozReview-Commit-ID: 66HfMlsXFLs
2016-03-02 10:35:56 -06:00
Yoshi Huang be5bd39145 Bug 1240651 - Annotate addonId into crash report (r=bholley) 2016-02-01 16:05:53 -08:00
Christoph Kerschbaumer fecee7be59 Bug 1224694 - Unify and clean up initialization of CSP (r=sicking) 2016-01-14 13:21:31 -08:00
Nigel Babu ccbf22eae8 Backed out changeset f001a01c85d7 (bug 1224694) for browser-chrome bustage on a CLOSED TREE
--HG--
extra : commitid : 5BUjoFsY8bv
2016-01-14 08:04:50 +05:30
Christoph Kerschbaumer 86457169b6 Bug 1224694 - Unify and clean up initialization of CSP (r=sicking) 2016-01-13 15:51:30 -08:00
Honza Bambas a0a6f7e23c Bug 1165214 - Use OriginAttributes in DOM Storage. r=smaug, r=bholley
--HG--
extra : rebase_source : b63ddb5a24a335f771a856cd20c69cdeb0c92ca0
2016-01-05 07:25:00 -05:00
Yoshi Huang 4b500464f5 Bug 1209162 - Create OriginAttributes subtypes. IGNORE IDL r=sicking. 2015-11-03 09:50:54 +08:00
Christoph Kerschbaumer b967444f19 Bug 663570 - MetaCSP Part 2: Principal changes (r=bz) 2015-11-14 19:28:23 -08:00
Bobby Holley 86c97bb3f4 Bug 1218039 - Add a nice interface for both C++ and JS to access the principal kind. r=gabor 2015-10-26 11:18:14 -07:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Yoshi Huang 02f27f9218 Bug 1211636 - use ToInteger64 in PopulateFromSuffix. r=bholley
From 76c9c3f887d6bce8b15abd37d5921887a187e18d Mon Sep 17 00:00:00 2001
---
 caps/BasePrincipal.cpp                    | 16 ++++++-------
 caps/moz.build                            |  3 +++
 caps/tests/gtest/TestOriginAttributes.cpp | 37 +++++++++++++++++++++++++++++++
 caps/tests/gtest/moz.build                | 13 +++++++++++
 4 files changed, 61 insertions(+), 8 deletions(-)
 create mode 100644 caps/tests/gtest/TestOriginAttributes.cpp
 create mode 100644 caps/tests/gtest/moz.build
2015-10-06 15:36:10 +08:00
Bobby Holley 75a560dba5 Bug 1208756 - Introduce URI_FETCHABLE_BY_ANYONE and use it for moz-extension. r=bz
This matches the behavior described in
https://developer.chrome.com/extensions/manifest/web_accessible_resources
2015-10-02 15:02:07 -07:00
Bobby Holley dca7589731 Bug 1208756 - Hoist shared CheckMayLoad logic into BasePrincipal. r=bz
This is a pure refactoring.
2015-10-02 14:59:45 -07:00
Yoshi Huang f97211a451 Bug 1167100 - User originAttribute in ContentPrincipalInfo. r=bholley 2015-09-23 18:19:06 +08:00
Bobby Holley ca4a8095de Bug 1209843 - Stop checking for UNKNOWN_APP_ID in all places except those where AppId() is explicitly queried. r=sicking 2015-09-30 16:29:36 -07:00
Stephanie Ouillon 5e14a3b3a8 Bug 1178533 - Add nsIInstallPackagedWebapp for registering permissions when navigating to signed packages r=bholley,fabrice,valentin 2015-08-26 13:12:13 +02:00
Wes Kocher df21b43278 Backed out changeset d0e88c95f3c5 (bug 1167100) for crashes a=backout 2015-09-29 10:25:20 -07:00
Yoshi Huang 872722fe37 Bug 1167100 - User nsIPrincipal.originAttribute in ContentPrincipalInfo. r=bholley 2015-09-23 18:19:06 +08:00
Yoshi Huang d38b78ae54 Bug 1165466 - Fix up docshell and loadcontext inheriting code in nsIScriptSecurityManager. r=bholley 2015-09-23 16:10:21 +08:00
Henry Chang b6b5862949 Bug 1163254 - Add signedPkg to OriginAttributes. r=bholley 2015-09-18 15:11:58 +08:00
Carsten "Tomcat" Book c5551bace9 Backed out 2 changesets (bug 1169633, bug 1163254) for linux Mn-e10s test bustage on a CLOSED TREE
Backed out changeset 47ccf6689101 (bug 1169633)
Backed out changeset 503eab197a2d (bug 1163254)
2015-09-17 16:01:25 +02:00
hchang 2e884ff477 Bug 1163254 - Add signedPkg to OriginAttributes. r=bholley 2015-09-16 19:42:00 +02:00
Bobby Holley ce93138568 Bug 1196371 - Add a runtime assertion against illegal string characters in OriginAttributes suffix creation. r=janv,r=mystor 2015-08-19 21:14:34 -07:00
Wes Kocher dab7b8a1ea Backed out changeset f00b7bf7b9f8 (bug 1196371) for build bustage CLOSED TREE 2015-08-19 15:49:30 -07:00
Bobby Holley 36e1d5fccf Bug 1196371 - Add a runtime assertion against illegal string characters in OriginAttributes suffix creation. r=janv,r=mystor 2015-08-19 14:51:58 -07:00
Steven Englehardt 754fd36b97 Bug 1179557 - Add getters for userContextId. r=bholley, r=tanvi
--HG--
extra : histedit_source : 29a5fb5f2a3204d27d0f620d6f3c03e134699fb9
2015-07-30 14:15:00 -04:00
Steven Englehardt 9d4063da89 Bug 1179557 - Add userContextId to originAttributes with tests. r=bholley, r=tanvi
--HG--
extra : histedit_source : 4d033ad9aef7b71c7ebbbe77242c94e9b8e94f0c
2015-07-28 17:32:00 -04:00
Michael Layzell 017f50b6d7 Bug 1172080 - Part 2: Use ^ instead of ! to delimit originAttributes from the URI in nsIPrincipal.origin, r=bholley 2015-07-16 14:50:07 -04:00
Bobby Holley 6955ea7475 Bug 1182610 - Check for UNKNOWN_APP_ID in nsIPrincipal::GetOrigin. r=gabor 2015-07-16 11:23:49 -07:00
Bobby Holley b4fdabe37d Bug 1182347 - Remove nsIPrincipal::cookieJar. r=sicking 2015-07-14 19:56:33 -07:00
Wes Kocher ff2f0d32cf Backed out 24 changesets (bug 1173523, bug 1172080, bug 817007, bug 1165263) for android reftest bustage CLOSED TREE
Backed out changeset 84fe04b2e7d1 (bug 1172080)
Backed out changeset 0ff004760a1f (bug 1172080)
Backed out changeset af147585ad55 (bug 1165263)
Backed out changeset c3af8ebb6db0 (bug 1165263)
Backed out changeset cd3f33a888fe (bug 1165263)
Backed out changeset e5db39044a1e (bug 1165263)
Backed out changeset c01c9ed77061 (bug 1165263)
Backed out changeset fb723aaa4267 (bug 1165263)
Backed out changeset f754e52e74dc (bug 1165263)
Backed out changeset c6bda3a0afd6 (bug 817007)
Backed out changeset bfa100253349 (bug 817007)
Backed out changeset b787b3f9aadc (bug 1173523)
Backed out changeset 4a0676b73f77 (bug 1173523)
Backed out changeset 82034a4560c5 (bug 1173523)
Backed out changeset 4bdb91114c7a (bug 1173523)
Backed out changeset 72406261eccc (bug 1173523)
Backed out changeset 541b6faf7196 (bug 1173523)
Backed out changeset 1caac4569616 (bug 1173523)
Backed out changeset 0d4f9f9e1b4e (bug 1173523)
Backed out changeset 2d5661eb966c (bug 1173523)
Backed out changeset 89833c0bb0cd (bug 1173523)
Backed out changeset ea64d70eacfe (bug 1173523)
Backed out changeset a8e4f1c0c445 (bug 1173523)
Backed out changeset cf498d466b85 (bug 1173523)
2015-07-14 14:00:32 -07:00
Michael Layzell 52f1ea5402 Bug 1172080 - Part 2: Use ^ instead of ! to delimit originAttributes from the URI in nsIPrincipal.origin, r=bholley 2015-07-14 15:06:42 -04:00
Birunthan Mohanathas a8939590de 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
Bobby Holley 260bd0121f Bug 1180921 - Support custom callbacks for allowing access per-addon load access to cross-origin URIs. r=bz,r=billm 2015-07-11 10:32:56 -04:00
Bobby Holley 94c6f14615 Bug 1180921 - Add the addonId OriginAttribute. r=bholley 2015-07-11 10:32:55 -04:00
Wes Kocher 45be9b06a3 Backed out 5 changesets (bug 1180921) for build failures in BasePrincipal.cpp
Backed out changeset d8c1a2e11a9a (bug 1180921)
Backed out changeset f4dd8c53df5f (bug 1180921)
Backed out changeset b272a0ebf5d8 (bug 1180921)
Backed out changeset 8e86b6a7d201 (bug 1180921)
Backed out changeset bbdebd7b8881 (bug 1180921)
2015-07-09 17:43:08 -07:00
Bobby Holley c9102e3238 Bug 1180921 - Support custom callbacks for allowing access per-addon load access to cross-origin URIs. r=bz,r=billm 2015-07-09 17:25:14 -07:00
Bobby Holley 24ce1d8fe4 Bug 1180921 - Add the addonId OriginAttribute. r=bholley 2015-07-09 17:25:05 -07:00
Dragana Damjanovic 7987d2203e Bug 905127 - Part 2 - remove unnecessary nsNetUtil.h includes r=jduell 2015-07-06 07:55:00 +02:00
Nikhil Marathe b52b66ebf5 Bug 1169044 - Patch 3 - Store and set principal with script URI on ServiceWorkers. r=ehsan
The ServiceWorkerRegistrationInfo's principal is the principal of the document
that called register(). If we create WorkerPrivate instances based off of
this, they have a valid principal in terms of security and same-origin-ness,
but the URI path is wrong. When fetching the script from the network, the
channel's principal is used to update the worker principal. We need to do the
same when the script is loaded from Cache. This patch adds support to store the
channel principal in the cache.

--HG--
extra : rebase_source : e7d527335aa4f0d4ee52e58915c8b0ef4ad26983
2015-06-04 21:39:34 -07:00
Nikhil Marathe 8dccad6eaa Bug 1169044 - Patch 2 - Split URLSearchParams parsing logic into non-CCed URLParams. r=baku
--HG--
extra : rebase_source : f68696ff1b2f2fabbb0ed015509477c65573768d
2015-06-04 13:45:24 -07:00
Andrea Marchesini 46ed66e379 Bug 1174731 - patch 1 - Make searchParams attribute readonly, r=smaug 2015-06-24 12:15:59 -07:00
Yoshi Huang a1b1318d82 Bug 1170097 - Part 2: Add originAttributesToCookieJar. r=bholley 2015-06-03 14:38:55 +08:00
Andrea Marchesini dcdcd94a06 Bug 1155153 - about:serviceworkers should work in e10s mode, r=nsm, r=bholley 2015-06-04 19:51:57 +01:00
Carsten "Tomcat" Book e7e949f08a Backed out changeset bc305c9b5d05 (bug 1155153) for b2g xpshell test failure on a CLOSED TREE 2015-06-05 13:07:51 +02:00
Andrea Marchesini 42cd5b397c Bug 1155153 - about:serviceworkers should work in e10s mode, r=nsm, r=bholley 2015-06-04 19:51:57 +01:00
Bobby Holley 7df20a2925 Bug 1171175 - Improve BasePrincipal::IsCodebasePrincipal. r=baku 2015-06-04 10:01:40 -07:00
Andrea Marchesini a71e717b67 Bug 1162088 - patch 1 - ServiceWorkerManager should use OriginAttributes from the principal as scopeKey, r=nsm, r=bholley 2015-06-03 09:43:43 +01:00
Bobby Holley ab5b0aa248 Bug 1170311 - Stop asserting non-null argument to nsIPrincipal::{subsumes,equals}{,ConsideringDomain}. r=gabor 2015-06-02 10:45:10 -07:00
Christoph Kerschbaumer f679dfded5 Bug 1129999 - Implement CSP devtool using GCLI; CSP to JSON (r=sstamm,bholley) 2015-05-21 11:16:04 -07:00
Bobby Holley 497b7c5b80 Bug 1165162 - Add nsIPrincipal::cookieJar. r=sicking 2015-05-20 17:11:52 -07:00
Bobby Holley 3b6ba803a8 Bug 1165162 - Serialize originSuffix into .origin. r=gabor,sr=sicking
We also provide an opt-out for the original behavior, and use it in various
consumers that look like they need fixing up. Most of the usage here is in
code with persistence considerations, where we may need some sort of migration
path.
2015-05-20 17:11:49 -07:00
Bobby Holley 9a937e13f4 Bug 1165162 - Hoist GetOrigin onto BasePrincipal. r=gabor 2015-05-20 17:11:48 -07:00
Bobby Holley 91e0c12696 Bug 1165162 - Rework the nsIScriptSecurityManager principal-minting API to be originAttributes-centric. r=gabor,r=bholley,sr=sicking 2015-05-20 17:11:41 -07:00
Bobby Holley eea636ee0c Bug 1165162 - Make OriginAttributes a dictionary, and make it accessible as both a jsval and a canonical string. r=gabor,r=bholley,sr=sicking 2015-05-20 17:09:53 -07:00
Bobby Holley d6082103c1 Bug 1164977 - Hoist attribute serialization into BasePrincipal. r=gabor 2015-05-18 15:52:34 -07:00
Bobby Holley f8d1d0c840 Bug 1164977 - Hoist app attributes into a struct on BasePrincipal and refer to them as 'origin attributes'. r=gabor
This sets the stage for the upcoming work for signed apps.
2015-05-18 15:52:34 -07:00
Bobby Holley 213bf81699 Bug 1164977 - Unify subsumes/equals logic on BasePrincipal and reduce duplicated code. r=gabor 2015-05-18 15:52:33 -07:00
Bobby Holley 9438ba6505 Bug 1164977 - Hoist all the app attribute handling into BasePrincipal. r=gabor 2015-05-18 15:52:33 -07:00
Bobby Holley 93d7d50247 Bug 1164292 - Make all nsIPrincipal implementations inherit BasePrincipal and hoist some repeated code. r=gabor
Losing the NS_DECL_NSIPRINCIPAL isn't great, but I think it's worth it to share
more code.
2015-05-15 11:51:50 -07:00
Bobby Holley 9e3345280e Bug 1164292 - Rebrand nsBasePrincipal into mozilla::BasePrincipal and give it its own file. r=gabor
The goal here is to provide a common superclass for _all_ the principal
implementations, rather than just nsPrincipal and nsExpandedPrincipal.
2015-05-15 11:51:49 -07:00