Bug 1400019 - Don't assert on illegal WebAuthn algo names r?keeler draft
authorJ.C. Jones <jjones@mozilla.com>
Thu, 14 Sep 2017 18:37:34 -0700
changeset 665193 81222bb5482dcbcf16340acba93039a27f583ee5
parent 664736 dd6b788f149763c4014c27f2fe1a1d13228bda82
child 731680 cf5a09884023a4ce99c98e188487fbaaa6a9a963
push id79958
push userbmo:jjones@mozilla.com
push dateFri, 15 Sep 2017 01:38:05 +0000
reviewerskeeler
bugs1400019
milestone57.0a1
Bug 1400019 - Don't assert on illegal WebAuthn algo names r?keeler The algorithm names provided to the WebAuthn methods have to either be a string, or (potentially) a WebCrypto object. Right now we only work with strings, but there's no good reason to assert that, we can just let the action fail. This patch removes the assert to help out the fuzzing team. MozReview-Commit-ID: 9dc8m0a2gZK
dom/webauthn/WebAuthnManager.cpp
--- a/dom/webauthn/WebAuthnManager.cpp
+++ b/dom/webauthn/WebAuthnManager.cpp
@@ -51,18 +51,16 @@ NS_IMPL_ISUPPORTS(WebAuthnManager, nsIIP
  * Utility Functions
  **********************************************************************/
 
 template<class OOS>
 static nsresult
 GetAlgorithmName(const OOS& aAlgorithm,
                  /* out */ nsString& aName)
 {
-  MOZ_ASSERT(aAlgorithm.IsString()); // TODO: remove assertion when we coerce.
-
   if (aAlgorithm.IsString()) {
     // If string, then treat as algorithm name
     aName.Assign(aAlgorithm.GetAsString());
   } else {
     // TODO: Coerce to string and extract name. See WebCryptoTask.cpp
   }
 
   // Only ES256 is currently supported