1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 # osclientcerts is currently only implemented for Windows
8 # osclientcerts transitively depends on winapi 0.2.8, which doesn't work with
10 if (CONFIG["OS_ARCH"] == "WINNT" and CONFIG["TARGET_CPU"] != "aarch64") or CONFIG[
13 DIRS += ["osclientcerts"]
15 DIRS += ["ipcclientcerts"]
18 TEST_DIRS += ["tests"]
21 "nsICertificateDialogs.idl",
22 "nsICertOverrideService.idl",
25 "nsIClientAuthDialogService.idl",
26 "nsIClientAuthRememberService.idl",
27 "nsIContentSignatureVerifier.idl",
30 "nsINSSComponent.idl",
31 "nsINSSErrorsService.idl",
34 "nsIOSReauthenticator.idl",
37 "nsIPKCS11Module.idl",
38 "nsIPKCS11ModuleDB.idl",
40 "nsIPublicKeyPinningService.idl",
41 "nsISecretDecoderRing.idl",
42 "nsISecurityUITelemetry.idl",
43 "nsISiteSecurityService.idl",
44 "nsITLSSocketControl.idl",
45 "nsITokenPasswordDialogs.idl",
46 "nsITransportSecurityInfo.idl",
49 "nsIX509CertValidity.idl",
52 XPIDL_MODULE = "pipnss"
58 EXTRA_JS_MODULES.psm += [
59 "ClientAuthDialogService.sys.mjs",
61 "RemoteSecuritySettings.sys.mjs",
66 "CommonSocketControl.h",
69 "nsClientAuthRemember.h",
74 "nsRandomGenerator.h",
75 "nsSecureBrowserUI.h",
76 "nsSecurityHeaderParser.h",
78 "nsSSLSocketProvider.h",
79 "nsTLSSocketProvider.h",
80 "RootCertificateTelemetryUtils.h",
82 "SharedCertVerifier.h",
83 "SSLServerCertVerification.h",
84 "TransportSecurityInfo.h",
88 "crypto_hash/crypto_hash_sha2.h",
92 EXPORTS.mozilla.psm += [
93 "IPCClientCertsChild.h",
94 "IPCClientCertsParent.h",
95 "SelectTLSClientAuthCertChild.h",
96 "SelectTLSClientAuthCertParent.h",
97 "TransportSecurityInfo.h",
98 "VerifySSLServerCertChild.h",
99 "VerifySSLServerCertParent.h",
103 "AppSignatureVerification.cpp",
104 "AppTrustDomain.cpp",
105 "CertStorageMemoryReporting.cpp",
106 "CommonSocketControl.cpp",
107 "ContentSignatureVerifier.cpp",
109 "DataStorageManager.cpp",
110 "EnterpriseRoots.cpp",
111 "IPCClientCertsChild.cpp",
112 "IPCClientCertsParent.cpp",
114 "nsCertOverrideService.cpp",
116 "nsClientAuthRemember.cpp",
117 "nsNSSCallbacks.cpp",
118 "nsNSSCertHelper.cpp",
119 "nsNSSCertificate.cpp",
120 "nsNSSCertificateDB.cpp",
121 "nsNSSCertTrust.cpp",
122 "nsNSSComponent.cpp",
126 "nsNTLMAuthModule.cpp",
130 "nsRandomGenerator.cpp",
131 "nsSecureBrowserUI.cpp",
132 "nsSecurityHeaderParser.cpp",
133 "NSSErrorsService.cpp",
134 "nsSiteSecurityService.cpp",
136 "nsSSLSocketProvider.cpp",
137 "NSSSocketControl.cpp",
138 "nsTLSSocketProvider.cpp",
140 "PKCS11ModuleDB.cpp",
142 "PublicKeyPinningService.cpp",
143 "RootCertificateTelemetryUtils.cpp",
144 "SecretDecoderRing.cpp",
145 "SSLServerCertVerification.cpp",
146 "TLSClientAuthCertSelection.cpp",
147 "TransportSecurityInfo.cpp",
148 "VerifySSLServerCertChild.cpp",
149 "VerifySSLServerCertParent.cpp",
150 "X509CertValidity.cpp",
153 if CONFIG["OS_ARCH"] == "WINNT":
154 # On Windows this file includes ntsecapi.h, which contains definitions that
155 # conflict with headers included in remaining source files. We compile this
156 # one independently to prevent that interferance.
158 "OSReauthenticator.cpp",
162 "OSReauthenticator.cpp",
165 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
169 CFLAGS += CONFIG["GLIB_CFLAGS"]
170 CXXFLAGS += CONFIG["GLIB_CFLAGS"]
171 CFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
172 CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
174 if CONFIG["TARGET_KERNEL"] == "Darwin":
176 "KeychainSecret.cpp",
177 "OSReauthenticatorDarwin.mm",
180 "-framework LocalAuthentication",
181 "-framework Security",
184 if CONFIG["OS_ARCH"] == "WINNT":
185 OS_LIBS += ["credui"]
187 "CredentialManagerSecret.cpp",
191 "PIPCClientCerts.ipdl",
192 "PSelectTLSClientAuthCert.ipdl",
194 "PVerifySSLServerCert.ipdl",
197 FINAL_LIBRARY = "xul"
204 "/security/certverifier",
205 "/third_party/rust/cose-c/include",
210 "nsSTSPreloadListGenerated.inc",
211 script="../../../xpcom/ds/tools/make_dafsa.py",
212 inputs=["nsSTSPreloadList.inc"],
215 DEFINES["SSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES"] = "True"
216 DEFINES["NSS_ENABLE_ECC"] = "True"
218 # mozpkix is linked statically from the in-tree sources independent of whether
219 # system NSS is used or not.
220 USE_LIBS += ["mozpkix"]
222 include("/ipc/chromium/chromium-config.mozbuild")
224 if CONFIG["CC_TYPE"] in ("clang", "gcc"):
227 # -Wextra enables this warning, but it's too noisy to be useful.
228 "-Wno-missing-field-initializers",
231 # Gecko headers aren't warning-free enough for us to enable these warnings.
233 "-Wno-unused-parameter",
236 headers_arrays_certs = [
241 "tests/unit/test_signed_apps/xpcshellTestRoot.pem",
242 "tests/unit/test_signed_apps/xpcshellTestRoot2.pem",
245 ("addons-public.inc", "addonsPublicRoots", ["addons-public.pem"]),
247 "addons-public-intermediate.inc",
248 "addonsPublicIntermediates",
249 ["addons-public-intermediate.pem"],
251 ("addons-stage.inc", "addonsStageRoots", ["addons-stage.pem"]),
253 "addons-stage-intermediate.inc",
254 "addonsStageIntermediates",
255 ["addons-stage-intermediate.pem"],
258 "content-signature-prod.inc",
259 "contentSignatureProdRoots",
260 ["content-signature-prod.pem"],
263 "content-signature-stage.inc",
264 "contentSignatureStageRoots",
265 ["content-signature-stage.pem"],
267 # The dev root is the same as the stage root.
269 "content-signature-dev.inc",
270 "contentSignatureDevRoots",
271 ["content-signature-stage.pem"],
274 "content-signature-local.inc",
275 "contentSignatureLocalRoots",
276 ["content-signature-local.pem"],
280 for header, array_name, certs in headers_arrays_certs:
283 script="gen_cert_header.py",
284 entry_point="generate",