Bug 1551342 - Don't assert the thread calling JNI WebAuthn functions r=snorp
authorJ.C. Jones <jjones@mozilla.com>
Thu, 16 May 2019 19:08:15 +0000
changeset 532981 5fae8054799fd916ceca727611c2f99afc83e93e
parent 532980 578cc4c154efb9d1d54da26e2f2818df88b3971e
child 533043 67eb2cac32c2db9e105ef3b38480c8de56f0ddfe
push id11276
push userrgurzau@mozilla.com
push dateMon, 20 May 2019 13:11:24 +0000
treeherdermozilla-beta@847755a7c325 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1551342
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1551342 - Don't assert the thread calling JNI WebAuthn functions r=snorp The mozilla::java::WebAuthnTokenManager asserts its return-to-C++ callbacks as being run on the main Android UI thread, but since these methods are called directly from the Fido2PendingIntent listeners, there's no guarantee of that. We don't actually care what thread was tasked with returning us data, just that it gets done, so let's not assert the thread here. Differential Revision: https://phabricator.services.mozilla.com/D31497
mobile/android/geckoview/src/main/java/org/mozilla/gecko/WebAuthnTokenManager.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/WebAuthnTokenManager.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/WebAuthnTokenManager.java
@@ -123,21 +123,21 @@ public class WebAuthnTokenManager {
                         authenticatorSelection, extensions, handler);
         } catch (Exception e) {
             Log.w(LOGTAG, "Couldn't run WebAuthnUtils", e);
             webAuthnMakeCredentialReturnError("UNKNOWN_ERR");
             return;
         }
     }
 
-    @WrapForJNI(calledFrom = "ui", dispatchTo = "gecko")
+    @WrapForJNI(dispatchTo = "gecko")
     /* package */ static native void webAuthnMakeCredentialFinish(final byte[] clientDataJson,
                                                                   final byte[] keyHandle,
                                                                   final byte[] attestationObject);
-    @WrapForJNI(calledFrom = "ui", dispatchTo = "gecko")
+    @WrapForJNI(dispatchTo = "gecko")
     /* package */ static native void webAuthnMakeCredentialReturnError(String errorCode);
 
     public interface WebAuthnGetAssertionResponse {
         void onSuccess(final byte[] clientDataJson, final byte[] keyHandle,
                        final byte[] authData, final byte[] signature,
                        final byte[] userHandle);
         void onFailure(String errorCode);
     }
@@ -196,17 +196,17 @@ public class WebAuthnTokenManager {
                         extensions, handler);
         } catch (Exception e) {
             Log.w(LOGTAG, "Couldn't run WebAuthnUtils", e);
             webAuthnGetAssertionReturnError("UNKNOWN_ERR");
             return;
         }
     }
 
-    @WrapForJNI(calledFrom = "ui", dispatchTo = "gecko")
+    @WrapForJNI(dispatchTo = "gecko")
     /* package */ static native void webAuthnGetAssertionFinish(final byte[] clientDataJson,
                                                                 final byte[] keyHandle,
                                                                 final byte[] authData,
                                                                 final byte[] signature,
                                                                 final byte[] userHandle);
-    @WrapForJNI(calledFrom = "ui", dispatchTo = "gecko")
+    @WrapForJNI(dispatchTo = "gecko")
     /* package */ static native void webAuthnGetAssertionReturnError(String errorCode);
 }