Bug 1330138 - Differentiate prefs for u2f and webauthn apis; r=jcj r?baku draft
authorKyle Machulis <kyle@nonpolynomial.com>
Wed, 11 Jan 2017 14:09:03 -0800
changeset 459426 490f48df5cf53c9aefdc9c8a21d094cb4f73484f
parent 459425 764af907f1ac68bf53276e3c78e853becc9ec88d
child 459427 0c241bedc82699fe6b918e5b7115f54d59f884b6
push id41224
push userbmo:kyle@nonpolynomial.com
push dateThu, 12 Jan 2017 00:30:40 +0000
reviewersjcj, baku
bugs1330138
milestone53.0a1
Bug 1330138 - Differentiate prefs for u2f and webauthn apis; r=jcj r?baku MozReview-Commit-ID: EUpleNqjFKQ
dom/webauthn/WebAuthentication.cpp
dom/webidl/Navigator.webidl
netwerk/base/security-prefs.js
--- a/dom/webauthn/WebAuthentication.cpp
+++ b/dom/webauthn/WebAuthentication.cpp
@@ -8,18 +8,18 @@
 #include "mozilla/dom/WebAuthnAssertion.h"
 #include "mozilla/dom/WebAuthnAttestation.h"
 
 #include "mozilla/dom/Promise.h"
 #include "nsICryptoHash.h"
 #include "pkix/Input.h"
 #include "pkixutil.h"
 
-#define PREF_U2F_SOFTTOKEN_ENABLED "security.webauth.u2f_enable_softtoken"
-#define PREF_U2F_USBTOKEN_ENABLED  "security.webauth.u2f_enable_usbtoken"
+#define PREF_WEBAUTHN_SOFTTOKEN_ENABLED "security.webauth.webauthn_enable_softtoken"
+#define PREF_WEBAUTHN_USBTOKEN_ENABLED  "security.webauth.webauthn_enable_usbtoken"
 
 namespace mozilla {
 namespace dom {
 
 static mozilla::LazyLogModule gWebauthLog("webauthn");
 
 // Only needed for refcounted objects.
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WebAuthentication, mParent)
@@ -286,17 +286,17 @@ WebAuthentication::InitLazily()
   // This only functions in e10s mode
   // TODO: Remove in Bug 1323339
   if (XRE_IsParentProcess()) {
     MOZ_LOG(gWebauthLog, LogLevel::Debug,
             ("Is non-e10s Process, WebAuthn not available"));
     return NS_ERROR_FAILURE;
   }
 
-  if (Preferences::GetBool(PREF_U2F_SOFTTOKEN_ENABLED)) {
+  if (Preferences::GetBool(PREF_WEBAUTHN_SOFTTOKEN_ENABLED)) {
     if (!mAuthenticators.AppendElement(new NSSU2FTokenRemote(),
                                        mozilla::fallible)) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
   }
 
   mInitialized = true;
   return NS_OK;
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -377,11 +377,11 @@ partial interface Navigator {
 #endif
 
 [NoInterfaceObject, Exposed=(Window,Worker)]
 interface NavigatorConcurrentHardware {
   readonly attribute unsigned long long hardwareConcurrency;
 };
 
 partial interface Navigator {
-  [Pref="security.webauth.w3c", SameObject]
+  [Pref="security.webauth.webauthn", SameObject]
   readonly attribute WebAuthentication authentication;
 };
--- a/netwerk/base/security-prefs.js
+++ b/netwerk/base/security-prefs.js
@@ -88,17 +88,20 @@ pref("security.pki.netscape_step_up_poli
 // Configures Certificate Transparency support mode:
 // 0: Fully disabled.
 // 1: Only collect telemetry. CT qualification checks are not performed.
 pref("security.pki.certificate_transparency.mode", 1);
 
 pref("security.webauth.u2f", false);
 pref("security.webauth.u2f_enable_softtoken", false);
 pref("security.webauth.u2f_enable_usbtoken", false);
-pref("security.webauth.w3c", false);
+
+pref("security.webauth.webauthn", false);
+pref("security.webauth.webauthn_enable_softtoken", false);
+pref("security.webauth.webauthn_enable_usbtoken", false);
 
 pref("security.ssl.errorReporting.enabled", true);
 pref("security.ssl.errorReporting.url", "https://incoming.telemetry.mozilla.org/submit/sslreports/");
 pref("security.ssl.errorReporting.automatic", false);
 
 // Impose a maximum age on HPKP headers, to avoid sites getting permanently
 // blacking themselves out by setting a bad pin.  (60 days by default)
 // https://tools.ietf.org/html/rfc7469#section-4.1