WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-230906-20211011162319.patch (text/plain), 43.26 KB, created by
Garrett Davidson
on 2021-10-11 16:23:20 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Garrett Davidson
Created:
2021-10-11 16:23:20 PDT
Size:
43.26 KB
patch
obsolete
>Subversion Revision: 283943 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index aaddccb96cc98e49e0bb3fb1486f9e21c5264f04..dde87f535ecf7abcad804a9d62df3ee616ff4b31 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,92 @@ >+2021-09-28 Garrett Davidson <garrett_davidson@apple.com> >+ >+ Adopt platform UI for WebAuthn >+ https://bugs.webkit.org/show_bug.cgi?id=230906 >+ <rdar://74659556> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Switch to using the platform's UI for WebAuthn transactions, where available, >+ which takes precedence over the WebAuthn process. >+ >+ Covered by existing tests. >+ >+ * Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h: >+ When possible, switch to importing the umbrella header directly instead of >+ redeclaring the entire interface. >+ >+ Also, fix an existing bug caused by the redeclaration, where the >+ ASCSecurityKeyPublicKeyCredentialKind enum was renamed. >+ >+ * SourcesCocoa.txt: >+ Build the new file. >+ >+ * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: >+ (-[_WKWebAuthenticationPanel makeCredentialWithChallenge:origin:options:completionHandler:]): >+ Return the full error to the delegate. >+ >+ * UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.h: >+ * UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.mm: >+ Add all of the new required classes for soft linking, and sort the list. >+ >+ * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: Added. >+ (WebKit::toArrayBuffer): >+ (WebKit::toNSData): >+ (WebKit::toNSString): >+ (WebKit::toExceptionCode): >+ (WebKit::toASCDescriptor): >+ Helper methods for converting between WK and ASC types. >+ >+ (WebKit::configureRegistrationRequestContext): >+ (WebKit::configurationAssertionRequestContext): >+ Create and configure an ASCCredentialRequestContext from the provided options. >+ >+ (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential): >+ (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion): >+ Configure and perform the request. >+ >+ (WebKit::WebAuthenticatorCoordinatorProxy::performRequest): >+ - Create a proxy to talk to AuthenticationServicesAgent. >+ - Ask the proxy if we're allowed to perform the request. >+ - If no, return an error. >+ - If yes, create presenter and present over the web page's window. >+ - When the request if finished, check the kind of credential we got, and return >+ the relevant AuthenticatorResponseData/AuthenticatorAttachment. >+ - If the request was canceled or failed, `credential` will be nil and `error` will >+ be non-nil. In most cases, the error will be WKErrorDomain, which we can convert >+ directly to ExceptionData. The one exception is the user canceled the request in >+ the platform UI, so return the appropriate ExceptionData in that case. The final >+ "Operation failed." case covers anything else unexpected happening. >+ >+ (WebKit::WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailable): >+ If +shouldUseAlternateCredentialStore is true, this is always true. Otherwise, >+ fall back to the old behavior. >+ >+ * UIProcess/WebAuthentication/Cocoa/WKASCAuthorizationPresenterDelegate.mm: >+ (-[WKASCAuthorizationPresenterDelegate authorizationPresenter:credentialRequestedForLoginChoice:authenticatedContext:completionHandler:]): >+ Use the new name of the enum, unconditionally. >+ >+ * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: >+ Wrap a few methods in the new flag. When the flag is on, these methods will exist >+ in WebAuthenticatorCoordinatorProxy.mm. >+ >+ * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: >+ New ivar and method for the platform presenter. >+ Make the superclass public so we can use the WeakPtr inheritance. >+ >+ * UIProcess/ios/WKHoverPlatterParameters.mm: >+ Add some missing imports since this file got pushed off the end of >+ UnifiedSource47-mm.mm. >+ >+ * WebKit.xcodeproj/project.pbxproj: >+ Add the new file. >+ >+ * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: >+ When platform UI is available, prefer it over the WebAuthn process. >+ (WebKit::WebAuthenticatorCoordinator::makeCredential): >+ (WebKit::WebAuthenticatorCoordinator::getAssertion): >+ (WebKit::WebAuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable): >+ > 2021-10-11 Wenson Hsieh <wenson_hsieh@apple.com> > > Introduce RemoteDisplayListRecorderProxy and RemoteDisplayListRecorder >diff --git a/Source/WebKit/Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h b/Source/WebKit/Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h >index 7c33cbeb1a4540fd55d75142d24cab7d874ac720..f2708e6e1f020755ff93327f71dfc053e4d77309 100644 >--- a/Source/WebKit/Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h >+++ b/Source/WebKit/Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h >@@ -25,19 +25,9 @@ > > #pragma once > >-#if HAVE(ASC_AUTH_UI) >- >-// FIXME<rdar://problem/72406585>: Uncomment the headers after the SDK becomes stable. >-//#if USE(APPLE_INTERNAL_SDK) >-// >-//// FIXME(219767): Remove ASCAppleIDCredential.h. >-//#import <AuthenticationServicesCore/ASCAppleIDCredential.h> >-//#import <AuthenticationServicesCore/ASCAuthorizationPresentationContext.h> >-//#import <AuthenticationServicesCore/ASCAuthorizationPresenter.h> >-//#import <AuthenticationServicesCore/ASCPlatformPublicKeyCredentialLoginChoice.h> >-//#import <AuthenticationServicesCore/ASCSecurityKeyPublicKeyCredentialLoginChoice.h> >-// >-//#else >+#if HAVE(UNIFIED_ASC_AUTH_UI) >+#import <AuthenticationServicesCore/AuthenticationServicesCorePrivate.h> >+#elif HAVE(ASC_AUTH_UI) > > NS_ASSUME_NONNULL_BEGIN > >@@ -108,10 +98,10 @@ extern NSString * const ASCAuthorizationPresentationContextDataKey; > > @end > >-typedef NS_ENUM(NSInteger, ASCSecurityKeyPublicKeyCredentialLoginChoiceKind) { >- ASCSecurityKeyPublicKeyCredentialLoginChoiceKindRegistration, >- ASCSecurityKeyPublicKeyCredentialLoginChoiceKindAssertion, >- ASCSecurityKeyPublicKeyCredentialLoginChoiceKindAssertionPlaceholder, >+typedef NS_ENUM(NSInteger, ASCSecurityKeyPublicKeyCredentialKind) { >+ ASCSecurityKeyPublicKeyCredentialKindRegistration, >+ ASCSecurityKeyPublicKeyCredentialKindAssertion, >+ ASCSecurityKeyPublicKeyCredentialKindAssertionPlaceholder, > }; > > @interface ASCPublicKeyCredentialCreationOptions : NSObject <NSSecureCoding> >@@ -136,7 +126,7 @@ typedef NS_ENUM(NSInteger, ASCSecurityKeyPublicKeyCredentialLoginChoiceKind) { > @property (nonatomic, nullable, readonly, copy) NSString *name; > @property (nonatomic, nullable, readonly, copy) NSString *displayName; > @property (nonatomic, nullable, readonly, copy) NSData *userHandle; >-@property (nonatomic, readonly) ASCSecurityKeyPublicKeyCredentialLoginChoiceKind loginChoiceKind; >+@property (nonatomic, readonly) ASCSecurityKeyPublicKeyCredentialKind credentialKind; > > + (instancetype)new NS_UNAVAILABLE; > - (instancetype)init NS_UNAVAILABLE; >diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt >index 3722ef8f5f3ec7c0cabf5f709e29d56bdcc71b73..c27468b9848bfaafe4909bf132971e26db883a2c 100644 >--- a/Source/WebKit/SourcesCocoa.txt >+++ b/Source/WebKit/SourcesCocoa.txt >@@ -592,6 +592,7 @@ UIProcess/WebAuthentication/Cocoa/NfcService.mm > UIProcess/WebAuthentication/Cocoa/WKASCAuthorizationPresenterDelegate.mm > UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.mm > UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm >+UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm > > UIProcess/WebAuthentication/Mock/MockLocalConnection.mm > UIProcess/WebAuthentication/Mock/MockLocalService.mm >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm >index 038632c90a04b5b1f38c0c3e511d9b7af33d7ff1..586d1eca34b247d4c99998584df8e3213e106780 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm >@@ -540,7 +540,7 @@ static RetainPtr<_WKAuthenticatorAttestationResponse> wkAuthenticatorAttestation > WTF::switchOn(result, [&](const Ref<WebCore::AuthenticatorResponse>& response) { > handler(wkAuthenticatorAttestationResponse(response->data(), clientDataJSON.get(), response->attachment()).get(), nil); > }, [&](const WebCore::ExceptionData& exception) { >- handler(nil, [NSError errorWithDomain:WKErrorDomain code:WKErrorUnknown userInfo:nil]); >+ handler(nil, [NSError errorWithDomain:WKErrorDomain code:exception.code userInfo:@{ NSLocalizedDescriptionKey: exception.message }]); > }); > }; > _panel->handleRequest({ WTFMove(hash), [_WKWebAuthenticationPanel convertToCoreCreationOptionsWithOptions:options], nullptr, WebKit::WebAuthenticationPanelResult::Unavailable, nullptr, std::nullopt, { }, true, String(), nullptr }, WTFMove(callback)); >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.h b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.h >index c92f90017f539a953427de31a8f36298cc111c6e..b3a79c07aba2cbafeefefc6c67cae136f7222519 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.h >+++ b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.h >@@ -32,14 +32,23 @@ SOFT_LINK_FRAMEWORK_FOR_HEADER(WebKit, AuthenticationServicesCore); > > SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCWebKitSPISupport); > >-#if HAVE(ASC_AUTH_UI) >+#if HAVE(ASC_AUTH_UI) || HAVE(UNIFIED_ASC_AUTH_UI) > >-SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCAuthorizationPresenter); >+SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCAgentProxy); >+SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCAppleIDCredential); > SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCAuthorizationPresentationContext); >+SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCAuthorizationPresenter); >+SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCAuthorizationRemotePresenter); >+SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCCredentialRequestContext); >+SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCPlatformPublicKeyCredentialAssertion); > SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCPlatformPublicKeyCredentialLoginChoice); >-SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCSecurityKeyPublicKeyCredentialLoginChoice); >-SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCAppleIDCredential); >+SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCPlatformPublicKeyCredentialRegistration); >+SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCPublicKeyCredentialAssertionOptions); > SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCPublicKeyCredentialCreationOptions); >+SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCPublicKeyCredentialDescriptor); >+SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCSecurityKeyPublicKeyCredentialAssertion); >+SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCSecurityKeyPublicKeyCredentialLoginChoice); >+SOFT_LINK_CLASS_FOR_HEADER(WebKit, ASCSecurityKeyPublicKeyCredentialRegistration); > > SOFT_LINK_CONSTANT_FOR_HEADER(WebKit, AuthenticationServicesCore, ASCAuthorizationErrorDomain, NSErrorDomain); > #define ASCAuthorizationErrorDomain WebKit::get_AuthenticationServicesCore_ASCAuthorizationErrorDomain() >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.mm b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.mm >index b9313c86dd7dc5000662aabc3d53238ea7cf52cb..a23ac53a7bc19a2e2525ed36920d0ddc34f3286d 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.mm >+++ b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.mm >@@ -32,14 +32,23 @@ SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(WebKit, AuthenticationServicesCore); > > SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCWebKitSPISupport); > >-#if HAVE(ASC_AUTH_UI) >+#if HAVE(ASC_AUTH_UI) || HAVE(UNIFIED_ASC_AUTH_UI) > >-SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCAuthorizationPresenter); >+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCAgentProxy); >+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCAppleIDCredential); > SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCAuthorizationPresentationContext); >+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCAuthorizationPresenter); >+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCAuthorizationRemotePresenter); >+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCCredentialRequestContext); >+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCPlatformPublicKeyCredentialAssertion); > SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCPlatformPublicKeyCredentialLoginChoice); >-SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCSecurityKeyPublicKeyCredentialLoginChoice); >-SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCAppleIDCredential); >+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCPlatformPublicKeyCredentialRegistration); >+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCPublicKeyCredentialAssertionOptions); > SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCPublicKeyCredentialCreationOptions); >+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCPublicKeyCredentialDescriptor); >+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCSecurityKeyPublicKeyCredentialAssertion); >+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCSecurityKeyPublicKeyCredentialLoginChoice); >+SOFT_LINK_CLASS_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCSecurityKeyPublicKeyCredentialRegistration); > > SOFT_LINK_CONSTANT_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCAuthorizationErrorDomain, NSErrorDomain); > SOFT_LINK_CONSTANT_FOR_SOURCE(WebKit, AuthenticationServicesCore, ASCPINValidationResultKey, NSString*); >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WKASCAuthorizationPresenterDelegate.mm b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WKASCAuthorizationPresenterDelegate.mm >index 7c208ff0ad5700ec17db4438b68349a43cd26a99..f2950fe306915f01c7dab8b0290d70a3ec790315 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WKASCAuthorizationPresenterDelegate.mm >+++ b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WKASCAuthorizationPresenterDelegate.mm >@@ -78,7 +78,7 @@ NS_ASSUME_NONNULL_BEGIN > if ([loginChoice isKindOfClass:WebKit::getASCSecurityKeyPublicKeyCredentialLoginChoiceClass()]) { > auto *securityKeyLoginChoice = (ASCSecurityKeyPublicKeyCredentialLoginChoice *)loginChoice; > >- if ([securityKeyLoginChoice loginChoiceKind] == ASCSecurityKeyPublicKeyCredentialLoginChoiceKindAssertion) { >+ if ([securityKeyLoginChoice credentialKind] == ASCSecurityKeyPublicKeyCredentialKindAssertion) { > String loginChoiceName = securityKeyLoginChoice.name; > [self dispatchCoordinatorCallback:[loginChoiceName = WTFMove(loginChoiceName)] (WebKit::AuthenticatorPresenterCoordinator& coordinator) mutable { > coordinator.didSelectAssertionResponse(loginChoiceName, nil); >diff --git a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..cc62576a23edfe33bc4d7538fa9b69539e193fb3 >--- /dev/null >+++ b/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm >@@ -0,0 +1,351 @@ >+/* >+ * Copyright (C) 2021 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#if HAVE(UNIFIED_ASC_AUTH_UI) >+ >+#import "config.h" >+#import "WebAuthenticatorCoordinatorProxy.h" >+ >+#import "LocalService.h" >+#import "WKError.h" >+#import "WebAuthenticationRequestData.h" >+#import "WebPageProxy.h" >+#import <AuthenticationServices/ASCOSEConstants.h> >+#import <WebCore/AuthenticatorAttachment.h> >+#import <WebCore/AuthenticatorResponseData.h> >+#import <WebCore/ExceptionData.h> >+#import <WebCore/PublicKeyCredentialCreationOptions.h> >+#import <wtf/BlockPtr.h> >+ >+#import "AuthenticationServicesCoreSoftLink.h" >+ >+namespace WebKit { >+using namespace WebCore; >+ >+static inline Ref<ArrayBuffer> toArrayBuffer(NSData *data) >+{ >+ return ArrayBuffer::create(reinterpret_cast<const uint8_t*>(data.bytes), data.length); >+} >+ >+static inline RetainPtr<NSData> toNSData(const BufferSource& data) >+{ >+ return adoptNS([[NSData alloc] initWithBytes:data.data() length:data.length()]); >+} >+ >+static inline RetainPtr<NSData> toNSData(const Vector<uint8_t> vector) >+{ >+ return adoptNS([[NSData alloc] initWithBytes:vector.data() length:vector.size()]); >+} >+ >+static inline RetainPtr<NSString> toNSString(UserVerificationRequirement userVerificationRequirement) >+{ >+ switch (userVerificationRequirement) { >+ case UserVerificationRequirement::Required: >+ return @"required"; >+ case UserVerificationRequirement::Discouraged: >+ return @"discouraged"; >+ case UserVerificationRequirement::Preferred: >+ return @"preferred"; >+ } >+ >+ return @"preferred"; >+} >+ >+static inline ExceptionCode toExceptionCode(NSInteger nsErrorCode) >+{ >+ ExceptionCode exceptionCode = (ExceptionCode)nsErrorCode; >+ >+ switch (exceptionCode) { >+ case IndexSizeError: FALLTHROUGH; >+ case HierarchyRequestError: FALLTHROUGH; >+ case WrongDocumentError: FALLTHROUGH; >+ case InvalidCharacterError: FALLTHROUGH; >+ case NoModificationAllowedError: FALLTHROUGH; >+ case NotFoundError: FALLTHROUGH; >+ case NotSupportedError: FALLTHROUGH; >+ case InUseAttributeError: FALLTHROUGH; >+ case InvalidStateError: FALLTHROUGH; >+ case SyntaxError: FALLTHROUGH; >+ case InvalidModificationError: FALLTHROUGH; >+ case NamespaceError: FALLTHROUGH; >+ case InvalidAccessError: FALLTHROUGH; >+ case TypeMismatchError: FALLTHROUGH; >+ case SecurityError: FALLTHROUGH; >+ case NetworkError: FALLTHROUGH; >+ case AbortError: FALLTHROUGH; >+ case URLMismatchError: FALLTHROUGH; >+ case QuotaExceededError: FALLTHROUGH; >+ case TimeoutError: FALLTHROUGH; >+ case InvalidNodeTypeError: FALLTHROUGH; >+ case DataCloneError: FALLTHROUGH; >+ case EncodingError: FALLTHROUGH; >+ case NotReadableError: FALLTHROUGH; >+ case UnknownError: FALLTHROUGH; >+ case ConstraintError: FALLTHROUGH; >+ case DataError: FALLTHROUGH; >+ case TransactionInactiveError: FALLTHROUGH; >+ case ReadonlyError: FALLTHROUGH; >+ case VersionError: FALLTHROUGH; >+ case OperationError: FALLTHROUGH; >+ case NotAllowedError: FALLTHROUGH; >+ case RangeError: FALLTHROUGH; >+ case TypeError: FALLTHROUGH; >+ case JSSyntaxError: FALLTHROUGH; >+ case StackOverflowError: FALLTHROUGH; >+ case OutOfMemoryError: FALLTHROUGH; >+ case ExistingExceptionError: >+ return exceptionCode; >+ } >+ >+ return NotAllowedError; >+} >+ >+static inline RetainPtr<ASCPublicKeyCredentialDescriptor> toASCDescriptor(PublicKeyCredentialDescriptor descriptor) >+{ >+ RetainPtr<NSMutableArray<NSString *>> transports; >+ size_t transportCount = descriptor.transports.size(); >+ if (transportCount) { >+ transports = adoptNS([[NSMutableArray alloc] initWithCapacity:transportCount]); >+ >+ for (AuthenticatorTransport transport : descriptor.transports) { >+ NSString *transportString = nil; >+ switch (transport) { >+ case AuthenticatorTransport::Usb: >+ transportString = @"usb"; >+ break; >+ case AuthenticatorTransport::Nfc: >+ transportString = @"nfc"; >+ break; >+ case AuthenticatorTransport::Ble: >+ transportString = @"ble"; >+ break; >+ case AuthenticatorTransport::Internal: >+ transportString = @"internal"; >+ break; >+ } >+ >+ if (transportString) >+ [transports addObject:transportString]; >+ } >+ } >+ >+ return adoptNS([allocASCPublicKeyCredentialDescriptorInstance() initWithCredentialID:toNSData(descriptor.idVector).get() transports:transports.get()]); >+} >+ >+static RetainPtr<ASCCredentialRequestContext> configureRegistrationRequestContext(const PublicKeyCredentialCreationOptions& options) >+{ >+ ASCCredentialRequestTypes requestTypes = ASCCredentialRequestTypePlatformPublicKeyRegistration | ASCCredentialRequestTypeSecurityKeyPublicKeyRegistration; >+ >+ RetainPtr<NSString> userVerification; >+ bool shouldRequireResidentKey = false; >+ std::optional<PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria> authenticatorSelection = options.authenticatorSelection; >+ if (authenticatorSelection) { >+ std::optional<AuthenticatorAttachment> attachment = authenticatorSelection->authenticatorAttachment; >+ if (attachment == AuthenticatorAttachment::Platform) >+ requestTypes = ASCCredentialRequestTypePlatformPublicKeyRegistration; >+ else if (attachment == AuthenticatorAttachment::CrossPlatform) >+ requestTypes = ASCCredentialRequestTypeSecurityKeyPublicKeyRegistration; >+ >+ userVerification = toNSString(authenticatorSelection->userVerification); >+ >+ shouldRequireResidentKey = authenticatorSelection->requireResidentKey; >+ } >+ >+ auto requestContext = adoptNS([allocASCCredentialRequestContextInstance() initWithRequestTypes:requestTypes]); >+ [requestContext setRelyingPartyIdentifier:options.rp.id]; >+ >+ auto credentialCreationOptions = adoptNS([allocASCPublicKeyCredentialCreationOptionsInstance() init]); >+ >+ [credentialCreationOptions setChallenge:toNSData(options.challenge).get()]; >+ [credentialCreationOptions setRelyingPartyIdentifier:options.rp.id]; >+ [credentialCreationOptions setUserName:options.user.name]; >+ [credentialCreationOptions setUserIdentifier:toNSData(options.user.id).get()]; >+ [credentialCreationOptions setUserDisplayName:options.user.displayName]; >+ [credentialCreationOptions setUserVerificationPreference:userVerification.get()]; >+ [credentialCreationOptions setShouldRequireResidentKey:shouldRequireResidentKey]; >+ >+ RetainPtr<NSMutableArray<NSNumber *>> supportedAlgorithmIdentifiers = adoptNS([[NSMutableArray alloc] initWithCapacity:options.pubKeyCredParams.size()]); >+ for (PublicKeyCredentialCreationOptions::Parameters algorithmParameter : options.pubKeyCredParams) >+ [supportedAlgorithmIdentifiers addObject:@(algorithmParameter.alg)]; >+ >+ [credentialCreationOptions setSupportedAlgorithmIdentifiers:supportedAlgorithmIdentifiers.get()]; >+ >+ size_t excludedCredentialCount = options.excludeCredentials.size(); >+ if (excludedCredentialCount) { >+ RetainPtr<NSMutableArray<ASCPublicKeyCredentialDescriptor *>> excludedCredentials = adoptNS([[NSMutableArray alloc] initWithCapacity:excludedCredentialCount]); >+ >+ for (PublicKeyCredentialDescriptor descriptor : options.excludeCredentials) >+ [excludedCredentials addObject:toASCDescriptor(descriptor).get()]; >+ >+ [credentialCreationOptions setExcludedCredentials:excludedCredentials.get()]; >+ } >+ >+ if (requestTypes & ASCCredentialRequestTypePlatformPublicKeyRegistration) >+ [requestContext setPlatformKeyCredentialCreationOptions:credentialCreationOptions.get()]; >+ >+ if (requestTypes & ASCCredentialRequestTypeSecurityKeyPublicKeyRegistration) >+ [requestContext setSecurityKeyCredentialCreationOptions:credentialCreationOptions.get()]; >+ >+ return requestContext; >+} >+ >+static RetainPtr<ASCCredentialRequestContext> configurationAssertionRequestContext(const PublicKeyCredentialRequestOptions& options) >+{ >+ ASCCredentialRequestTypes requestTypes = ASCCredentialRequestTypePlatformPublicKeyAssertion | ASCCredentialRequestTypeSecurityKeyPublicKeyAssertion; >+ >+ RetainPtr<NSString> userVerification; >+ std::optional<AuthenticatorAttachment> attachment = options.authenticatorAttachment; >+ if (attachment == AuthenticatorAttachment::Platform) >+ requestTypes = ASCCredentialRequestTypePlatformPublicKeyAssertion; >+ else if (attachment == AuthenticatorAttachment::CrossPlatform) >+ requestTypes = ASCCredentialRequestTypeSecurityKeyPublicKeyAssertion; >+ >+ userVerification = toNSString(options.userVerification); >+ >+ size_t allowedCredentialCount = options.allowCredentials.size(); >+ RetainPtr<NSMutableArray<ASCPublicKeyCredentialDescriptor *>> allowedCredentials; >+ if (allowedCredentialCount) { >+ allowedCredentials = adoptNS([[NSMutableArray alloc] initWithCapacity:allowedCredentialCount]); >+ >+ for (PublicKeyCredentialDescriptor descriptor : options.allowCredentials) >+ [allowedCredentials addObject:toASCDescriptor(descriptor).get()]; >+ } >+ >+ auto requestContext = adoptNS([allocASCCredentialRequestContextInstance() initWithRequestTypes:requestTypes]); >+ [requestContext setRelyingPartyIdentifier:options.rpId]; >+ >+ NSData *challenge = toNSData(options.challenge).get(); >+ >+ if (requestTypes & ASCCredentialRequestTypePlatformPublicKeyAssertion) >+ [requestContext setPlatformKeyCredentialAssertionOptions:[allocASCPublicKeyCredentialAssertionOptionsInstance() initWithKind:ASCPublicKeyCredentialKindPlatform relyingPartyIdentifier:options.rpId challenge:challenge userVerificationPreference:userVerification.get() allowedCredentials:allowedCredentials.get()]]; >+ >+ if (requestTypes & ASCCredentialRequestTypeSecurityKeyPublicKeyAssertion) >+ [requestContext setSecurityKeyCredentialAssertionOptions:[allocASCPublicKeyCredentialAssertionOptionsInstance() initWithKind:ASCPublicKeyCredentialKindSecurityKey relyingPartyIdentifier:options.rpId challenge:challenge userVerificationPreference:userVerification.get() allowedCredentials:allowedCredentials.get()]]; >+ >+ return requestContext; >+} >+ >+void WebAuthenticatorCoordinatorProxy::makeCredential(FrameIdentifier frameId, FrameInfoData&& frameInfo, Vector<uint8_t>&& hash, PublicKeyCredentialCreationOptions&& options, bool processingUserGesture, RequestCompletionHandler&& handler) >+{ >+ auto requestContext = configureRegistrationRequestContext(options); >+ performRequest(requestContext, WTFMove(handler)); >+} >+ >+void WebAuthenticatorCoordinatorProxy::getAssertion(FrameIdentifier frameId, FrameInfoData&& frameInfo, Vector<uint8_t>&& hash, PublicKeyCredentialRequestOptions&& options, bool processingUserGesture, RequestCompletionHandler&& handler) >+{ >+ auto requestContext = configurationAssertionRequestContext(options); >+ performRequest(requestContext, WTFMove(handler)); >+} >+ >+void WebAuthenticatorCoordinatorProxy::performRequest(RetainPtr<ASCCredentialRequestContext> requestContext, RequestCompletionHandler&& handler) >+{ >+ auto proxy = adoptNS([allocASCAgentProxyInstance() init]); >+ >+ NSWindow *window = m_webPageProxy.platformWindow(); >+ [proxy performAuthorizationRequestsForContext:requestContext.get() withClearanceHandler:makeBlockPtr([weakThis = makeWeakPtr(*this), handler = WTFMove(handler), window = WTFMove(window)](NSXPCListenerEndpoint *daemonEnpoint, NSError *error) mutable { >+ auto protectedThis = weakThis.get(); >+ >+ if (!protectedThis || !daemonEnpoint) { >+ RunLoop::main().dispatch([handler = WTFMove(handler)]() mutable { >+ handler({ }, (AuthenticatorAttachment)0, ExceptionData { NotAllowedError, "Operation failed." }); >+ }); >+ return; >+ } >+ >+ protectedThis->m_presenter = adoptNS([allocASCAuthorizationRemotePresenterInstance() init]); >+ [protectedThis->m_presenter presentWithWindow:window daemonEndpoint:daemonEnpoint completionHandler:makeBlockPtr([handler = WTFMove(handler)](id <ASCCredentialProtocol> credential, NSError *error) mutable { >+ AuthenticatorResponseData response = { }; >+ AuthenticatorAttachment attachment; >+ ExceptionData exceptionData = { }; >+ >+ if ([credential isKindOfClass:getASCPlatformPublicKeyCredentialRegistrationClass()]) { >+ attachment = AuthenticatorAttachment::Platform; >+ response.isAuthenticatorAttestationResponse = true; >+ >+ ASCPlatformPublicKeyCredentialRegistration *registrationCredential = credential; >+ response.rawId = toArrayBuffer(registrationCredential.credentialID); >+ response.attestationObject = toArrayBuffer(registrationCredential.attestationObject); >+ } else if ([credential isKindOfClass:getASCSecurityKeyPublicKeyCredentialRegistrationClass()]) { >+ attachment = AuthenticatorAttachment::CrossPlatform; >+ response.isAuthenticatorAttestationResponse = true; >+ >+ ASCSecurityKeyPublicKeyCredentialRegistration *registrationCredential = credential; >+ response.rawId = toArrayBuffer(registrationCredential.credentialID); >+ response.attestationObject = toArrayBuffer(registrationCredential.attestationObject); >+ } else if ([credential isKindOfClass:getASCPlatformPublicKeyCredentialAssertionClass()]) { >+ attachment = AuthenticatorAttachment::Platform; >+ response.isAuthenticatorAttestationResponse = false; >+ >+ ASCPlatformPublicKeyCredentialAssertion *assertionCredential = credential; >+ response.rawId = toArrayBuffer(assertionCredential.credentialID); >+ response.authenticatorData = toArrayBuffer(assertionCredential.authenticatorData); >+ response.signature = toArrayBuffer(assertionCredential.signature); >+ response.userHandle = toArrayBuffer(assertionCredential.userHandle); >+ } else if ([credential isKindOfClass:getASCSecurityKeyPublicKeyCredentialAssertionClass()]) { >+ attachment = AuthenticatorAttachment::CrossPlatform; >+ response.isAuthenticatorAttestationResponse = false; >+ >+ ASCPlatformPublicKeyCredentialAssertion *assertionCredential = credential; >+ response.rawId = toArrayBuffer(assertionCredential.credentialID); >+ response.authenticatorData = toArrayBuffer(assertionCredential.authenticatorData); >+ response.signature = toArrayBuffer(assertionCredential.signature); >+ response.userHandle = toArrayBuffer(assertionCredential.userHandle); >+ } else { >+ attachment = (AuthenticatorAttachment) 0; >+ ExceptionCode exceptionCode; >+ NSString *errorMessage = nil; >+ if ([error.domain isEqualToString:WKErrorDomain]) { >+ exceptionCode = toExceptionCode(error.code); >+ errorMessage = error.userInfo[NSLocalizedDescriptionKey]; >+ } else { >+ exceptionCode = NotAllowedError; >+ >+ if ([error.domain isEqualToString:ASCAuthorizationErrorDomain] && error.code == ASCAuthorizationErrorUserCanceled) >+ errorMessage = @"This request has been cancelled by the user."; >+ else >+ errorMessage = @"Operation failed."; >+ } >+ >+ exceptionData = { exceptionCode, errorMessage }; >+ } >+ >+ handler(response, attachment, exceptionData); >+ }).get()]; >+ }).get()]; >+} >+ >+void WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailable(QueryCompletionHandler&& handler) >+{ >+ if ([getASCWebKitSPISupportClass() shouldUseAlternateCredentialStore]) { >+ handler(true); >+ return; >+ } >+ >+ handler(LocalService::isAvailable()); >+} >+ >+} // namespace WebKit >+ >+#endif // HAVE(UNIFIED_ASC_AUTH_UI) >diff --git a/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp b/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp >index 1ca0de04e01caa0347c55291491eebd247d47db4..1962854bdf4a823abbab04f50bc5fd7a130e1b2a 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp >+++ b/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp >@@ -55,6 +55,7 @@ WebAuthenticatorCoordinatorProxy::~WebAuthenticatorCoordinatorProxy() > m_webPageProxy.process().removeMessageReceiver(Messages::WebAuthenticatorCoordinatorProxy::messageReceiverName(), m_webPageProxy.webPageID()); > } > >+#if !HAVE(UNIFIED_ASC_AUTH_UI) > void WebAuthenticatorCoordinatorProxy::makeCredential(FrameIdentifier frameId, FrameInfoData&& frameInfo, Vector<uint8_t>&& hash, PublicKeyCredentialCreationOptions&& options, bool processingUserGesture, RequestCompletionHandler&& handler) > { > handleRequest({ WTFMove(hash), WTFMove(options), makeWeakPtr(m_webPageProxy), WebAuthenticationPanelResult::Unavailable, nullptr, GlobalFrameIdentifier { m_webPageProxy.webPageID(), frameId }, WTFMove(frameInfo), processingUserGesture, String(), nullptr }, WTFMove(handler)); >@@ -64,6 +65,7 @@ void WebAuthenticatorCoordinatorProxy::getAssertion(FrameIdentifier frameId, Fra > { > handleRequest({ WTFMove(hash), WTFMove(options), makeWeakPtr(m_webPageProxy), WebAuthenticationPanelResult::Unavailable, nullptr, GlobalFrameIdentifier { m_webPageProxy.webPageID(), frameId }, WTFMove(frameInfo), processingUserGesture, String(), nullptr }, WTFMove(handler)); > } >+#endif > > void WebAuthenticatorCoordinatorProxy::handleRequest(WebAuthenticationRequestData&& data, RequestCompletionHandler&& handler) > { >@@ -78,10 +80,12 @@ void WebAuthenticatorCoordinatorProxy::handleRequest(WebAuthenticationRequestDat > m_webPageProxy.websiteDataStore().authenticatorManager().handleRequest(WTFMove(data), WTFMove(callback)); > } > >+#if !HAVE(UNIFIED_ASC_AUTH_UI) > void WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailable(QueryCompletionHandler&& handler) > { > handler(LocalService::isAvailable()); > } >+#endif > > } // namespace WebKit > >diff --git a/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h b/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h >index 53f973b5a74db2c69a36c2ae6b2ccd879e422b8a..66877fd1068a4e531a8d825022d391c0468849ba 100644 >--- a/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h >+++ b/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h >@@ -41,6 +41,11 @@ struct PublicKeyCredentialRequestOptions; > struct SecurityOriginData; > } > >+#if HAVE(UNIFIED_ASC_AUTH_UI) >+OBJC_CLASS ASCAuthorizationRemotePresenter; >+OBJC_CLASS ASCCredentialRequestContext; >+#endif >+ > namespace WebKit { > > class WebPageProxy; >@@ -48,7 +53,7 @@ class WebPageProxy; > struct FrameInfoData; > struct WebAuthenticationRequestData; > >-class WebAuthenticatorCoordinatorProxy : private IPC::MessageReceiver { >+class WebAuthenticatorCoordinatorProxy : public IPC::MessageReceiver { > WTF_MAKE_FAST_ALLOCATED; > WTF_MAKE_NONCOPYABLE(WebAuthenticatorCoordinatorProxy); > public: >@@ -70,6 +75,11 @@ private: > void handleRequest(WebAuthenticationRequestData&&, RequestCompletionHandler&&); > > WebPageProxy& m_webPageProxy; >+ >+#if HAVE(UNIFIED_ASC_AUTH_UI) >+ void performRequest(RetainPtr<ASCCredentialRequestContext>, RequestCompletionHandler&&); >+ RetainPtr<ASCAuthorizationRemotePresenter> m_presenter; >+#endif > }; > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/ios/WKHoverPlatterParameters.mm b/Source/WebKit/UIProcess/ios/WKHoverPlatterParameters.mm >index f8408c7419cb96fa5dcefeddb628927d343e81cc..8466bcb98cde98bc6c99f3bc47114ba95675773e 100644 >--- a/Source/WebKit/UIProcess/ios/WKHoverPlatterParameters.mm >+++ b/Source/WebKit/UIProcess/ios/WKHoverPlatterParameters.mm >@@ -29,6 +29,8 @@ > #if HAVE(UIKIT_WITH_MOUSE_SUPPORT) || ENABLE(HOVER_GESTURE_RECOGNIZER) > > #import "PrototypeToolsSPI.h" >+#import <pal/spi/cocoa/QuartzCoreSPI.h> >+#import <wtf/RetainPtr.h> > > @interface PTSliderRow (WebKit) > >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 5b32eba2208a4d849c457071bca43896252170e5..5553b0465a0427874ad81b928642dd313ff6acbe 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -2525,6 +2525,7 @@ > 07E19F0923D533BA0094FFB4 /* TextTrackPrivateRemote.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextTrackPrivateRemote.h; sourceTree = "<group>"; }; > 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; > 089C1667FE841158C02AAC07 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; >+ 0DCBF4D926E2ED3200EA0E07 /* WebAuthenticatorCoordinatorProxy.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebAuthenticatorCoordinatorProxy.mm; sourceTree = "<group>"; }; > 0E97D74C200E8FF300BF6643 /* SafeBrowsingSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SafeBrowsingSPI.h; sourceTree = "<group>"; }; > 0EDE85022004E74900030560 /* WebsitePopUpPolicy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebsitePopUpPolicy.h; sourceTree = "<group>"; }; > 0F04159823C7CC720060A3E2 /* WKScrollViewMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKScrollViewMac.h; sourceTree = "<group>"; }; >@@ -9329,6 +9330,7 @@ > 570DAAAD23026F5C00E8FC04 /* NfcService.mm */, > 577FF7832346ECAA004EDFB9 /* WebAuthenticationPanelClient.h */, > 577FF7842346ECAA004EDFB9 /* WebAuthenticationPanelClient.mm */, >+ 0DCBF4D926E2ED3200EA0E07 /* WebAuthenticatorCoordinatorProxy.mm */, > 577739932580388F0059348B /* WKASCAuthorizationPresenterDelegate.h */, > 577739942580388F0059348B /* WKASCAuthorizationPresenterDelegate.mm */, > 570DAAC423037F7E00E8FC04 /* WKNFReaderSessionDelegate.h */, >diff --git a/Source/WebKit/WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp b/Source/WebKit/WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp >index d5458edbf4451ca588e9dfe47b2caeac5555a69c..1b12809f849198f9a3c726f0ba661c381d79bd21 100644 >--- a/Source/WebKit/WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp >+++ b/Source/WebKit/WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp >@@ -69,7 +69,12 @@ void WebAuthenticatorCoordinator::makeCredential(const Frame& frame, const Secur > return; > > auto isProcessingUserGesture = processingUserGesture(frame, webFrame->frameID()); >- if (!RuntimeEnabledFeatures::sharedFeatures().webAuthenticationModernEnabled()) { >+#if HAVE(UNIFIED_ASC_AUTH_UI) >+ bool useWebAuthnProcess = false; >+#else >+ bool useWebAuthnProcess = RuntimeEnabledFeatures::sharedFeatures().webAuthenticationModernEnabled(); >+#endif >+ if (!useWebAuthnProcess) { > m_webPage.sendWithAsyncReply(Messages::WebAuthenticatorCoordinatorProxy::MakeCredential(webFrame->frameID(), webFrame->info(), hash, options, isProcessingUserGesture), WTFMove(handler)); > return; > } >@@ -86,7 +91,12 @@ void WebAuthenticatorCoordinator::getAssertion(const Frame& frame, const Securit > return; > > auto isProcessingUserGesture = processingUserGesture(frame, webFrame->frameID()); >- if (!RuntimeEnabledFeatures::sharedFeatures().webAuthenticationModernEnabled()) { >+#if HAVE(UNIFIED_ASC_AUTH_UI) >+ bool useWebAuthnProcess = false; >+#else >+ bool useWebAuthnProcess = RuntimeEnabledFeatures::sharedFeatures().webAuthenticationModernEnabled(); >+#endif >+ if (!useWebAuthnProcess) { > m_webPage.sendWithAsyncReply(Messages::WebAuthenticatorCoordinatorProxy::GetAssertion(webFrame->frameID(), webFrame->info(), hash, options, isProcessingUserGesture), WTFMove(handler)); > return; > } >@@ -98,7 +108,12 @@ void WebAuthenticatorCoordinator::getAssertion(const Frame& frame, const Securit > > void WebAuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable(QueryCompletionHandler&& handler) > { >- if (!RuntimeEnabledFeatures::sharedFeatures().webAuthenticationModernEnabled()) { >+#if HAVE(UNIFIED_ASC_AUTH_UI) >+ bool useWebAuthnProcess = false; >+#else >+ bool useWebAuthnProcess = RuntimeEnabledFeatures::sharedFeatures().webAuthenticationModernEnabled(); >+#endif >+ if (!useWebAuthnProcess) { > m_webPage.sendWithAsyncReply(Messages::WebAuthenticatorCoordinatorProxy::IsUserVerifyingPlatformAuthenticatorAvailable(), WTFMove(handler)); > return; > } >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 2f1d7ba53ebfea8b4823fbc7efd7031a4dbf4f0f..df810e7fa206f4a51580b27cc4ca7dcd44ec366c 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,18 @@ >+2021-09-28 Garrett Davidson <garrett_davidson@apple.com> >+ >+ Adopt platform UI for WebAuthn >+ https://bugs.webkit.org/show_bug.cgi?id=230906 >+ <rdar://74659556> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update the timeout test to expect NotAllowedError, which is the expected error >+ code when a timeout occurs, per Step 21 of the "Create a New Credential" >+ algorithm. >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: >+ (TestWebKitAPI::TEST): >+ > 2021-10-11 Jonathan Bedard <jbedard@apple.com> > > [build-imagediff] Build universal binaries by default >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm >index 1945b5e325d9d0d3932d8cce147b8730ba045bf2..de03685811d984051c96a5bb77d629f6acb257be 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm >@@ -34,6 +34,7 @@ > #import "WKWebViewConfigurationExtras.h" > #import <LocalAuthentication/LocalAuthentication.h> > #import <WebCore/AuthenticatorAttachment.h> >+#import <WebCore/ExceptionCode.h> > #import <WebCore/PublicKeyCredentialCreationOptions.h> > #import <WebCore/PublicKeyCredentialRequestOptions.h> > #import <WebKit/WKPreferencesPrivate.h> >@@ -1830,7 +1831,7 @@ TEST(WebAuthenticationPanel, MakeCredentialSPITimeout) > > EXPECT_NULL(response); > EXPECT_EQ(error.domain, WKErrorDomain); >- EXPECT_EQ(error.code, WKErrorUnknown); >+ EXPECT_EQ(error.code, NotAllowedError); > }]; > Util::run(&webAuthenticationPanelRan); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 230906
:
439506
|
439552
|
439610
|
440305
|
440851
|
441011