Bug 237984 - [WebAuthn] Support makeCredential for virtual HID authenticators
Summary: [WebAuthn] Support makeCredential for virtual HID authenticators
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: pascoe@apple.com
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-16 14:53 PDT by pascoe@apple.com
Modified: 2022-03-17 11:29 PDT (History)
2 users (show)

See Also:


Attachments
Patch (52.78 KB, patch)
2022-03-16 15:00 PDT, pascoe@apple.com
no flags Details | Formatted Diff | Diff
Patch for landing (55.07 KB, patch)
2022-03-16 17:16 PDT, pascoe@apple.com
no flags Details | Formatted Diff | Diff
Patch for landing (55.02 KB, patch)
2022-03-17 09:56 PDT, pascoe@apple.com
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description pascoe@apple.com 2022-03-16 14:53:11 PDT
^
Comment 1 Radar WebKit Bug Importer 2022-03-16 14:53:22 PDT
<rdar://problem/90393676>
Comment 2 pascoe@apple.com 2022-03-16 15:00:22 PDT
Created attachment 454898 [details]
Patch
Comment 3 Brent Fulgham 2022-03-16 16:15:53 PDT
Comment on attachment 454898 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=454898&action=review

r=me

> Source/WebKit/UIProcess/WebAuthentication/Virtual/VirtualAuthenticatorUtils.mm:41
> +    int8_t flags = 0b01000000; // AT set

Nit: It might be nice to define constants for these values:

constexpr int8_t ATset = 0b01000000;
... etc...

> Source/WebKit/UIProcess/WebAuthentication/Virtual/VirtualAuthenticatorUtils.mm:45
> +        flags = flags | 0b00000100;

Then you could explain what this one means :-)

> Source/WebKit/UIProcess/WebAuthentication/Virtual/VirtualCredential.h:39
> +    bool isVerificationRequired;

Nit: Putting the bools together at the end of the struct can allow better packing of the structure and reduce memory use.

> Source/WebKit/UIProcess/WebAuthentication/Virtual/VirtualHidConnection.cpp:230
> +            Vector<uint8_t> buffer;

Is buffer ever large enough that it's worth hinting the size of the buffer before appending using the 'reserveCapacity' method?

buffer.reserveCapacity(payload.size() + 1)

Scanning through the code, there might be a number of places in the WebAuthn code where this could be helpful.
Comment 4 pascoe@apple.com 2022-03-16 17:16:12 PDT
Created attachment 454915 [details]
Patch for landing
Comment 5 EWS 2022-03-17 09:09:16 PDT
ChangeLog entry in Source/WebCore/ChangeLog contains OOPS!.
Comment 6 pascoe@apple.com 2022-03-17 09:56:47 PDT
Created attachment 454983 [details]
Patch for landing
Comment 7 EWS 2022-03-17 11:29:23 PDT
Committed r291423 (248550@main): <https://commits.webkit.org/248550@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 454983 [details].