Closed Bug 1552601 Opened 1 year ago Closed 1 year ago

NoSuchMethodException: {makeCredential, getAssertion} in WebAuthnUtils

Categories

(Core :: DOM: Web Authentication, defect, P1)

68 Branch
Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: jcj, Assigned: jcj)

References

(Regression)

Details

Attachments

(1 file)

On Fennec builds from 17 May 2019 (and possibly earlier), we're getting an exception when trying to Make Credential from WebAuhthn:

05-17 14:58:11.342 29599 29731 W WebAuthnTokenManager: Couldn't run WebAuthnUtils
05-17 14:58:11.342 29599 29731 W WebAuthnTokenManager: java.lang.NoSuchMethodException: makeCredential [class java.lang.String, class org.mozilla.gecko.util.GeckoBundle, class [B, class [B, long, class java.lang.String, class [Lorg.mozilla.gecko.WebAuthnTokenManager$WebAuthnPublicCredential;, class org.mozilla.gecko.util.GeckoBundle, class org.mozilla.gecko.util.GeckoBundle, interface org.mozilla.gecko.WebAuthnTokenManager$WebAuthnMakeCredentialResponse]
05-17 14:58:11.342 29599 29731 W WebAuthnTokenManager:  at java.lang.Class.getMethod(Class.java:2068)
05-17 14:58:11.342 29599 29731 W WebAuthnTokenManager:  at java.lang.Class.getDeclaredMethod(Class.java:2047)
05-17 14:58:11.342 29599 29731 W WebAuthnTokenManager:  at org.mozilla.gecko.WebAuthnTokenManager.webAuthnMakeCredential(WebAuthnTokenManager.java:118)
05-17 14:58:11.342 29599 29731 W WebAuthnTokenManager:  at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
05-17 14:58:11.342 29599 29731 W WebAuthnTokenManager:  at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:476)

The NoSuchMethodException happens after resolving the WebAuthnUtils class, so the class exists.

The method signature from above is:
makeCredential [class java.lang.String, class org.mozilla.gecko.util.GeckoBundle, class [B, class [B, long, class java.lang.String, class [Lorg.mozilla.gecko.WebAuthnTokenManager$WebAuthnPublicCredential;, class org.mozilla.gecko.util.GeckoBundle, class org.mozilla.gecko.util.GeckoBundle, interface org.mozilla.gecko.WebAuthnTokenManager$WebAuthnMakeCredentialResponse]

The one from current m-c is:

    public static void makeCredential(final String rpId, final GeckoBundle identifiers,
                                      final byte[] userId, final byte[] challenge,
                                      final long timeoutMs, final String originStr,
                                      final WebAuthnTokenManager.WebAuthnPublicCredential[] excludeList,
                                      final GeckoBundle authenticatorSelection,
                                      final GeckoBundle extensions,
                                      WebAuthnTokenManager.WebAuthnMakeCredentialResponse handler)```

Careful inspection shows a match of function signatures.

The involved files are:
https://hg.mozilla.org/mozilla-central/log/tip/mobile/android/geckoview/src/main/java/org/mozilla/gecko/WebAuthnTokenManager.java
https://hg.mozilla.org/mozilla-central/log/tip/mobile/android/base/java/org/mozilla/gecko/util/WebAuthnUtils.java

There's nothing as of morning 17 May 2019 that should have impacted these two classes. (Note, there's a consolidation patch on inbound that affects the signatures). The only external non-primitive type in that signature is GeckoBundle, which similarly is without change:

https://hg.mozilla.org/mozilla-central/log/tip/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GeckoBundle.java

This did work at the beginning of the week. It also works fine in local builds. So now the mystery is: Why all of a sudden is there a NoSuchMethodException?

Found the culprit, a Proguard rule update. Will produce a patch.

Regressed by: 1550596

A Proguard update in Bug 1550596 optimized away the WebAuthn methods, but
there's a convenient ReflectionTarget defined to say 'hey, don't do that.'

[Tracking Requested - why for this release]:
WebAuthn on Fennec is totally disabled without this patch. If we can't land before merge, we'll have to uplift this into Fennec 68.

Pushed by jjones@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2c73613d29c2
Annotate WebAuthn reflection methods as @ReflectionTarget r=nalexander
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.