Closed Bug 2080193 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63435 - [wpt] Fix webauthn add_credential/invalid.py null signCount expectation

Categories

(Remote Protocol :: Marionette, task, P4)

task

Tracking

(firefox160 fixed)

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Blocks 2 open bugs, )

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 63435 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/63435
Details from upstream follow.

Mike Taylor <miketaylr@chromium.org> wrote:

[wpt] Fix webauthn add_credential/invalid.py null signCount expectation

The test asserted that signCount: null must be rejected with
"invalid argument". However, w3c/webauthn#2382 made signCount nullable
to represent a credential without a signature counter, and ChromeDriver
implements this (see crrev.com/c/fc0cd539d551b "[chromedriver] Support
null signature counters"). The sibling set_credential_properties/set.py
test already treats None as a valid signCount, so invalid.py was
internally inconsistent with the rest of the suite. This made
test_sign_count_invalid_type[None] fail deterministically on all
platforms.

Remove None from the invalid-type cases and add a positive test in
add.py asserting that a credential with a null signCount is accepted
and read back with signCount == null.

Removes the [ Failure ] expectation. Both add.py and invalid.py pass
locally with run_wpt_tests.py (36 subtests).

Bug: 533056772
Change-Id: Ia8cecaf642a11dcfeab2ddf7830de6d4331be7a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8540564
Reviewed-by: Martin Kreichgauer \<martinkr@google.com>
Auto-Submit: Mike Taylor \<miketaylr@chromium.org>
Commit-Queue: Martin Kreichgauer \<martinkr@google.com>
Cr-Commit-Position: refs/heads/main@{#1714914}

Component: web-platform-tests → Marionette
Product: Testing → Remote Protocol
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 36 subtests

Status Summary

Firefox

OK : 2
PASS : 39
FAIL : 3

Chrome

OK : 1
PASS : 36
TIMEOUT: 1

Safari

OK : 2
FAIL : 1
ERROR : 41

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Michael, this is for your information. Not sure if there is a platform specific bug filed for it yet, but in Firefox we will see the tests failing with the upcoming changes.

Flags: needinfo?(micolous+moz)

Thanks! The actual error in test_add_credential_with_null_sign_count is at assert_success(response):

AssertionError: invalid argument (400): invalid type: null, expected u64 at line 1 column 306

The deserialisation error is probably thrown from WebDriver, because sign_count is declared as u64 (and also in geckodriver here), so serde throws a validation error.

Changing this field is related to Bug 2066804, and may also hit the issue noted in Bug 2064129, but slightly more complicated, because signCount will now also need an undefined state (ie: Option<u64> isn't enough because it makes null == undefined).

serde-json #376 says that serde doesn't actually support tracking field presence. There's a workaround using Option<Option<T>>.

Flags: needinfo?(micolous+moz)
See Also: → 2066804
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch

(In reply to Michael Farrell [:mfarrell] from comment #5)

The deserialisation error is probably thrown from WebDriver, because sign_count is declared as u64 (and also in geckodriver here), so serde throws a validation error.

Thanks. Michael, if it's something you want to see fixed in geckodriver sooner than later it would be a good idea to get this updated now. I'm about to release a new version soon - and it's not clear yet when the next one will follow. If you want this update to be included, maybe you could fix it? Note that we already use Option<Option<T>> for session timeouts definitions so it sounds fine.

Flags: needinfo?(micolous+moz)

Even if it was fixed in WebDriver, the field type change (to allow null) would need to be propagated to nsIWebAuthnService (and all its implementations), authrs_bridge's TestToken, and need to sort out the XPCOM nullability issue.

At best this would probably move the failure later in the function, as signCount would be set to 0.

I've opened Bug 2081517 to sort this properly.

Flags: needinfo?(micolous+moz)
You need to log in before you can comment on or make changes to this bug.