mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1313045 - Remove toolkit/identity, part2: Move used files/bits to services/crypto and remove remaining files in toolkit/identity. r=MattN.
--HG-- rename : toolkit/identity/IdentityCryptoService.cpp => services/crypto/component/IdentityCryptoService.cpp rename : toolkit/identity/nsIIdentityCryptoService.idl => services/crypto/component/nsIIdentityCryptoService.idl rename : toolkit/identity/LogUtils.jsm => services/crypto/modules/LogUtils.jsm rename : toolkit/identity/jwcrypto.jsm => services/crypto/modules/jwcrypto.jsm rename : toolkit/identity/tests/unit/test_crypto_service.js => services/crypto/tests/unit/test_crypto_service.js rename : toolkit/identity/tests/unit/test_jwcrypto.js => services/crypto/tests/unit/test_jwcrypto.js
This commit is contained in:
parent
f28e3f1e0d
commit
caff960805
@ -233,7 +233,6 @@
|
||||
@RESPATH@/components/gfx.xpt
|
||||
@RESPATH@/components/html5.xpt
|
||||
@RESPATH@/components/htmlparser.xpt
|
||||
@RESPATH@/components/identity.xpt
|
||||
@RESPATH@/components/imglib2.xpt
|
||||
@RESPATH@/components/inspector.xpt
|
||||
@RESPATH@/components/intl.xpt
|
||||
|
@ -7,12 +7,14 @@
|
||||
XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIIdentityCryptoService.idl',
|
||||
'nsISyncJPAKE.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'services-crypto-component'
|
||||
|
||||
SOURCES += [
|
||||
'IdentityCryptoService.cpp',
|
||||
'nsSyncJPAKE.cpp',
|
||||
]
|
||||
|
||||
|
@ -14,7 +14,7 @@ const Cr = Components.results;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/identity/LogUtils.jsm");
|
||||
Cu.import("resource://gre/modules/services-crypto/LogUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this,
|
||||
"IdentityCryptoService",
|
@ -12,6 +12,8 @@ DIRS += ['component']
|
||||
XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
|
||||
|
||||
EXTRA_JS_MODULES['services-crypto'] += [
|
||||
'modules/jwcrypto.jsm',
|
||||
'modules/LogUtils.jsm',
|
||||
'modules/utils.js',
|
||||
'modules/WeaveCrypto.js',
|
||||
]
|
||||
|
@ -29,6 +29,29 @@ updateAppInfo({
|
||||
});
|
||||
}
|
||||
|
||||
function base64UrlDecode(s) {
|
||||
s = s.replace(/-/g, "+");
|
||||
s = s.replace(/_/g, "/");
|
||||
|
||||
// Replace padding if it was stripped by the sender.
|
||||
// See http://tools.ietf.org/html/rfc4648#section-4
|
||||
switch (s.length % 4) {
|
||||
case 0:
|
||||
break; // No pad chars in this case
|
||||
case 2:
|
||||
s += "==";
|
||||
break; // Two pad chars
|
||||
case 3:
|
||||
s += "=";
|
||||
break; // One pad char
|
||||
default:
|
||||
throw new InputException("Illegal base64url string!");
|
||||
}
|
||||
|
||||
// With correct padding restored, apply the standard base64 decoder
|
||||
return atob(s);
|
||||
}
|
||||
|
||||
// Register resource alias. Normally done in SyncComponents.manifest.
|
||||
function addResourceAlias() {
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
Cu.import("resource://gre/modules/identity/LogUtils.jsm");
|
||||
Cu.import("resource://gre/modules/services-crypto/LogUtils.jsm");
|
||||
|
||||
const idService = Cc["@mozilla.org/identity/crypto-service;1"]
|
||||
.getService(Ci.nsIIdentityCryptoService);
|
@ -4,7 +4,7 @@
|
||||
"use strict"
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "jwcrypto",
|
||||
"resource://gre/modules/identity/jwcrypto.jsm");
|
||||
"resource://gre/modules/services-crypto/jwcrypto.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this,
|
||||
"CryptoService",
|
@ -11,6 +11,10 @@ support-files =
|
||||
[test_crypto_random.js]
|
||||
# Bug 676977: test hangs consistently on Android
|
||||
skip-if = os == "android"
|
||||
[test_crypto_service.js]
|
||||
skip-if = os == "android"
|
||||
[test_jwcrypto.js]
|
||||
skip-if = os == "android"
|
||||
|
||||
[test_utils_hawk.js]
|
||||
[test_utils_hkdfExpand.js]
|
||||
|
@ -26,7 +26,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "FxAccountsConfig",
|
||||
"resource://gre/modules/FxAccountsConfig.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "jwcrypto",
|
||||
"resource://gre/modules/identity/jwcrypto.jsm");
|
||||
"resource://gre/modules/services-crypto/jwcrypto.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FxAccountsOAuthGrantClient",
|
||||
"resource://gre/modules/FxAccountsOAuthGrantClient.jsm");
|
||||
|
@ -1,24 +0,0 @@
|
||||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIIdentityCryptoService.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'identity'
|
||||
|
||||
SOURCES += [
|
||||
'IdentityCryptoService.cpp',
|
||||
]
|
||||
|
||||
EXTRA_JS_MODULES.identity += [
|
||||
'jwcrypto.jsm',
|
||||
'LogUtils.jsm',
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
@ -1,32 +0,0 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
var Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
function base64UrlDecode(s) {
|
||||
s = s.replace(/-/g, "+");
|
||||
s = s.replace(/_/g, "/");
|
||||
|
||||
// Replace padding if it was stripped by the sender.
|
||||
// See http://tools.ietf.org/html/rfc4648#section-4
|
||||
switch (s.length % 4) {
|
||||
case 0:
|
||||
break; // No pad chars in this case
|
||||
case 2:
|
||||
s += "==";
|
||||
break; // Two pad chars
|
||||
case 3:
|
||||
s += "=";
|
||||
break; // One pad char
|
||||
default:
|
||||
throw new InputException("Illegal base64url string!");
|
||||
}
|
||||
|
||||
// With correct padding restored, apply the standard base64 decoder
|
||||
return atob(s);
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
[DEFAULT]
|
||||
head = head_identity.js
|
||||
skip-if = os == "android"
|
||||
|
||||
[test_crypto_service.js]
|
||||
[test_jwcrypto.js]
|
@ -8,7 +8,6 @@ DIRS += [
|
||||
'components',
|
||||
'content',
|
||||
'forgetaboutsite',
|
||||
'identity',
|
||||
'locales',
|
||||
'modules',
|
||||
'mozapps/downloads',
|
||||
|
Loading…
Reference in New Issue
Block a user