Bug 237984

Summary: [WebAuthn] Support makeCredential for virtual HID authenticators
Product: WebKit Reporter: pascoe <pascoe>
Component: WebKit Misc.Assignee: pascoe <pascoe>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing
none
Patch for landing none

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].