Bug 234112 - [WebAuthn] Provide SPI to export/import local credentials
Summary: [WebAuthn] Provide SPI to export/import local credentials
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: 2021-12-09 17:01 PST by pascoe@apple.com
Modified: 2022-01-31 08:57 PST (History)
5 users (show)

See Also:


Attachments
Patch (17.81 KB, patch)
2021-12-10 07:10 PST, pascoe@apple.com
no flags Details | Formatted Diff | Diff
Patch (19.00 KB, patch)
2022-01-25 16:20 PST, pascoe@apple.com
no flags Details | Formatted Diff | Diff
Patch (21.22 KB, patch)
2022-01-25 17:41 PST, pascoe@apple.com
no flags Details | Formatted Diff | Diff
Patch (20.79 KB, patch)
2022-01-26 17:26 PST, pascoe@apple.com
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (20.85 KB, patch)
2022-01-26 17:32 PST, 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 2021-12-09 17:01:16 PST
Provide SPI to export/import local credentials.
Comment 1 pascoe@apple.com 2021-12-09 17:01:32 PST
rdar://84822000
Comment 2 pascoe@apple.com 2021-12-10 07:10:28 PST
Created attachment 446722 [details]
Patch
Comment 3 pascoe@apple.com 2022-01-21 12:00:20 PST
Reminder to make these SPIs synchronous.
Comment 4 pascoe@apple.com 2022-01-25 16:20:13 PST
Created attachment 449981 [details]
Patch
Comment 5 Darin Adler 2022-01-25 17:05:36 PST
Comment on attachment 449981 [details]
Patch

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

> Source/WebCore/Modules/webauthn/WebAuthenticationConstants.h:80
>  const char LocalAuthenticatiorAccessGroup[] = "com.apple.webkit.webauthn";

Misspelled word "authenticator" here.

> Source/WebCore/Modules/webauthn/WebAuthenticationConstants.h:87
> +const char privateKeyKey[] = "priv";
> +const char keyTypeKey[] = "key_type";
> +const char keySizeKey[] = "key_size";
> +const char relyingPartyKey[] = "rp";
> +const char applicationTagKey[] = "tag";

constexpr?
Comment 6 pascoe@apple.com 2022-01-25 17:41:11 PST
Created attachment 449987 [details]
Patch
Comment 7 Brent Fulgham 2022-01-26 15:45:08 PST
Comment on attachment 449987 [details]
Patch

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

r=me

> Source/WebCore/Modules/webauthn/WebAuthenticationConstants.h:80
> +constexpr const char LocalAuthenticatorAccessGroup[] = "com.apple.webkit.webauthn";

Thank you for fixing that typo!

> Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:397
> +            *error = [NSError errorWithDomain:WKErrorDomain code:WKErrorMalformedCredential userInfo:nil];

This little check and assignment is repeated so many times it might be nice as a static function:

static void createMalformedCredentialErrorIfNecessary(NSError **error)

> Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:488
> +            *error = [NSError errorWithDomain:WKErrorDomain code:WKErrorDuplicateCredential userInfo:nil];

... or, perhaps a helper that takes the WKError type:

static void createNSErrorFromWKErrorIfNecessary(NSError **error, WKErrorCode errorCode)
{
    if (error)
         *error = [NSError errorWithDomain:WKErrorDomain code: errorCode userInfo:nil];
}
Comment 8 pascoe@apple.com 2022-01-26 17:26:32 PST
Created attachment 450088 [details]
Patch
Comment 9 pascoe@apple.com 2022-01-26 17:32:33 PST
Created attachment 450089 [details]
Patch for landing
Comment 10 EWS 2022-01-31 08:56:58 PST
Committed r288816 (246592@main): <https://commits.webkit.org/246592@main>

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