Bug 1178518 - Add an AppTrustedRoot for signed packaged app. r=keeler

This commit is contained in:
Jonathan Hao 2015-09-07 15:28:21 +08:00
parent 077ea1aeb2
commit e2da61623b
6 changed files with 12 additions and 1 deletions

View File

@ -16,6 +16,7 @@ const APP_TRUSTED_ROOTS= ["AppMarketplaceProdPublicRoot",
"AppMarketplaceDevPublicRoot",
"AppMarketplaceDevReviewersRoot",
"AppMarketplaceStageRoot",
"PrivilegedPackageRoot",
"AppXPCShellRoot"];
this.TrustedRootCertificate = {

View File

@ -26,6 +26,8 @@
// Add-on signing Certificates
#include "addons-public.inc"
#include "addons-stage.inc"
// Privileged Package Certificates
#include "privileged-package-root.inc"
using namespace mozilla::pkix;
@ -94,6 +96,11 @@ AppTrustDomain::SetTrustedRoot(AppTrustedRoot trustedRoot)
trustedDER.len = mozilla::ArrayLength(addonsStageRoot);
break;
case nsIX509CertDB::PrivilegedPackageRoot:
trustedDER.data = const_cast<uint8_t*>(privilegedPackageRoot);
trustedDER.len = mozilla::ArrayLength(privilegedPackageRoot);
break;
default:
PR_SetError(SEC_ERROR_INVALID_ARGS, 0);
return SECFailure;

View File

@ -37,6 +37,7 @@ array_names = [
'xpcshellRoot',
'addonsPublicRoot',
'addonsStageRoot',
'privilegedPackageRoot',
]
for n in array_names:

View File

@ -34,6 +34,7 @@ headers_arrays_certs = [
('xpcshell.inc', 'xpcshellRoot', test_ssl_path + '/test_signed_apps/trusted_ca1.der'),
('addons-public.inc', 'addonsPublicRoot', 'addons-public.crt'),
('addons-stage.inc', 'addonsStageRoot', 'addons-stage.crt'),
('privileged-package-root.inc', 'privilegedPackageRoot', 'privileged-package-root.der'),
]
for header, array_name, cert in headers_arrays_certs:

Binary file not shown.

View File

@ -46,7 +46,7 @@ interface nsIVerifySignedManifestCallback : nsISupports
* This represents a service to access and manipulate
* X.509 certificates stored in a database.
*/
[scriptable, uuid(3fe3702b-766b-47dd-8f77-c08c3a339a74)]
[scriptable, uuid(0a47571d-602c-4b21-9f52-c3d0e681d83a)]
interface nsIX509CertDB : nsISupports {
/**
@ -318,6 +318,7 @@ interface nsIX509CertDB : nsISupports {
const AppTrustedRoot AppXPCShellRoot = 6;
const AppTrustedRoot AddonsPublicRoot = 7;
const AppTrustedRoot AddonsStageRoot = 8;
const AppTrustedRoot PrivilegedPackageRoot = 9;
void openSignedAppFileAsync(in AppTrustedRoot trustedRoot,
in nsIFile aJarFile,
in nsIOpenSignedAppFileCallback callback);