Changeset 268575 in webkit
- Timestamp:
- Oct 16, 2020 12:52:45 AM (3 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r268543 r268575 1 2020-10-15 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthn] Move AppAttestInternal related code from WKA to OpenSource 4 https://bugs.webkit.org/show_bug.cgi?id=217790 5 <rdar://problem/59613406> 6 7 Reviewed by Brent Fulgham. 8 9 * wtf/PlatformHave.h: 10 1 11 2020-10-15 David Kilzer <ddkilzer@apple.com> 2 12 -
trunk/Source/WTF/wtf/PlatformHave.h
r268148 r268575 736 736 #define HAVE_PENCILKIT_TEXT_INPUT 1 737 737 #endif 738 739 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000 || PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) 740 #if !defined(HAVE_APPLE_ATTESTATION) 741 #define HAVE_APPLE_ATTESTATION 1 742 #endif 743 #endif -
trunk/Source/WebKit/ChangeLog
r268570 r268575 1 2020-10-15 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthn] Move AppAttestInternal related code from WKA to OpenSource 4 https://bugs.webkit.org/show_bug.cgi?id=217790 5 <rdar://problem/59613406> 6 7 Reviewed by Brent Fulgham. 8 9 Covered by manual testing. 10 11 * Platform/spi/Cocoa/AppAttestSPI.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/AppAttestInternalSoftLink.mm. 12 * SourcesCocoa.txt: 13 * UIProcess/WebAuthentication/Cocoa/AppAttestInternalSoftLink.h: Added. 14 * UIProcess/WebAuthentication/Cocoa/AppAttestInternalSoftLink.mm: Added. 15 * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm: 16 (WebKit::LocalConnection::getAttestation const): 17 * UIProcess/WebAuthentication/Cocoa/LocalService.mm: 18 (WebKit::LocalService::isAvailable): 19 * WebKit.xcodeproj/project.pbxproj: 20 1 21 2020-10-15 David Kilzer <ddkilzer@apple.com> 2 22 -
trunk/Source/WebKit/Platform/spi/Cocoa/AppAttestSPI.h
r268574 r268575 1 1 /* 2 * Copyright (C) 20 18Apple Inc. All rights reserved.2 * Copyright (C) 2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #import "config.h" 27 #import "LocalService.h" 28 29 #if ENABLE(WEB_AUTHN) 30 31 #import "LocalAuthenticator.h" 32 #import "LocalConnection.h" 26 #pragma once 33 27 34 28 #if USE(APPLE_INTERNAL_SDK) 35 #import <WebKitAdditions/LocalServiceAdditions.h>36 #endif37 29 38 #import "LocalAuthenticationSoftLink.h"30 #import <AppAttestInternal/AppAttest.h> 39 31 40 namespace WebKit { 32 #else 41 33 42 LocalService::LocalService(Observer& observer) 43 : AuthenticatorTransportService(observer) 44 { 45 } 34 WTF_EXTERN_C_BEGIN 46 35 47 bool LocalService::isAvailable() 48 { 49 auto context = adoptNS([allocLAContextInstance() init]); 50 NSError *error = nil; 51 if (![context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) { 52 LOG_ERROR("Couldn't find local authenticators: %@", error); 53 return false; 54 } 36 BOOL AppAttest_WebAuthentication_IsSupported(void); 55 37 56 #if defined(LOCALSERVICE_ADDITIONS) 57 LOCALSERVICE_ADDITIONS 58 #else 59 return false; 60 #endif 38 typedef void (^AppAttest_WebAuthentication_AttestKeyCompletionBlock) (NSArray * _Nullable certificates, NSError * _Nullable error); 61 39 62 return true; 63 } 40 void AppAttest_WebAuthentication_AttestKey(SecKeyRef _Nonnull referenceKey, NSData * _Nonnull authenticatorData, NSData * _Nonnull clientDataHash, AppAttest_WebAuthentication_AttestKeyCompletionBlock _Nonnull completion); 64 41 65 void LocalService::startDiscoveryInternal() 66 { 67 if (!platformStartDiscovery() || !observer()) 68 return; 69 observer()->authenticatorAdded(LocalAuthenticator::create(createLocalConnection())); 70 } 42 WTF_EXTERN_C_END 71 43 72 bool LocalService::platformStartDiscovery() const 73 { 74 return LocalService::isAvailable(); 75 } 76 77 UniqueRef<LocalConnection> LocalService::createLocalConnection() const 78 { 79 return makeUniqueRef<LocalConnection>(); 80 } 81 82 } // namespace WebKit 83 84 #endif // ENABLE(WEB_AUTHN) 44 #endif // USE(APPLE_INTERNAL_SDK) -
trunk/Source/WebKit/SourcesCocoa.txt
r268521 r268575 531 531 UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp 532 532 533 UIProcess/WebAuthentication/Cocoa/AppAttestInternalSoftLink.mm @no-unify 533 534 UIProcess/WebAuthentication/Cocoa/HidConnection.mm 534 535 UIProcess/WebAuthentication/Cocoa/HidService.mm -
trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.mm
r261118 r268575 34 34 #import <wtf/RunLoop.h> 35 35 36 #if USE(APPLE_INTERNAL_SDK) 37 #import <WebKitAdditions/LocalConnectionAdditions.h> 38 #endif 39 36 #import "AppAttestInternalSoftLink.h" 40 37 #import "LocalAuthenticationSoftLink.h" 41 38 … … 126 123 void LocalConnection::getAttestation(SecKeyRef privateKey, NSData *authData, NSData *hash, AttestationCallback&& completionHandler) const 127 124 { 128 #if defined(LOCALCONNECTION_ADDITIONS) 129 LOCALCONNECTION_ADDITIONS 125 #if HAVE(APPLE_ATTESTATION) 126 AppAttest_WebAuthentication_AttestKey(privateKey, authData, hash, makeBlockPtr([completionHandler = WTFMove(completionHandler)] (NSArray *certificates, NSError *error) mutable { 127 completionHandler(certificates, error); 128 }).get()); 130 129 #endif 131 130 } -
trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalService.mm
r257877 r268575 32 32 #import "LocalConnection.h" 33 33 34 #if USE(APPLE_INTERNAL_SDK) 35 #import <WebKitAdditions/LocalServiceAdditions.h> 36 #endif 37 34 #import "AppAttestInternalSoftLink.h" 38 35 #import "LocalAuthenticationSoftLink.h" 39 36 … … 54 51 } 55 52 56 #if defined(LOCALSERVICE_ADDITIONS) 57 LOCALSERVICE_ADDITIONS 53 #if HAVE(APPLE_ATTESTATION) 54 if (!AppAttest_WebAuthentication_IsSupported()) { 55 LOG_ERROR("Device is unable to support Apple attestation features."); 56 return false; 57 } 58 58 #else 59 59 return false; -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r268521 r268575 1097 1097 570DAAC623037F7F00E8FC04 /* WKNFReaderSessionDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 570DAAC423037F7E00E8FC04 /* WKNFReaderSessionDelegate.h */; }; 1098 1098 570DAACA230385FD00E8FC04 /* CtapNfcDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 570DAAC8230385FD00E8FC04 /* CtapNfcDriver.h */; }; 1099 572EBBDA2538F6B4000552B3 /* AppAttestInternalSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 572EBBD82538F6A1000552B3 /* AppAttestInternalSoftLink.mm */; }; 1100 572EBBDB2538F6B6000552B3 /* AppAttestInternalSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 572EBBD92538F6A1000552B3 /* AppAttestInternalSoftLink.h */; }; 1101 572EBBDD25392181000552B3 /* AppAttestSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 572EBBDC25392181000552B3 /* AppAttestSPI.h */; }; 1099 1102 572FD44322265CE200A1ECC3 /* WebViewDidMoveToWindowObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 572FD44122265CE200A1ECC3 /* WebViewDidMoveToWindowObserver.h */; }; 1100 1103 574217922400E286002B303D /* LocalAuthenticationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 574217912400E098002B303D /* LocalAuthenticationSPI.h */; }; … … 3911 3914 570DAAC8230385FD00E8FC04 /* CtapNfcDriver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CtapNfcDriver.h; sourceTree = "<group>"; }; 3912 3915 570DAAC9230385FD00E8FC04 /* CtapNfcDriver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CtapNfcDriver.cpp; sourceTree = "<group>"; }; 3916 572EBBD82538F6A1000552B3 /* AppAttestInternalSoftLink.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppAttestInternalSoftLink.mm; sourceTree = "<group>"; }; 3917 572EBBD92538F6A1000552B3 /* AppAttestInternalSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppAttestInternalSoftLink.h; sourceTree = "<group>"; }; 3918 572EBBDC25392181000552B3 /* AppAttestSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppAttestSPI.h; sourceTree = "<group>"; }; 3913 3919 572FD44122265CE200A1ECC3 /* WebViewDidMoveToWindowObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebViewDidMoveToWindowObserver.h; sourceTree = "<group>"; }; 3914 3920 574217912400E098002B303D /* LocalAuthenticationSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalAuthenticationSPI.h; sourceTree = "<group>"; }; … … 7218 7224 children = ( 7219 7225 E3CAAA432413278A00CED2E2 /* AccessibilitySupportSPI.h */, 7226 572EBBDC25392181000552B3 /* AppAttestSPI.h */, 7220 7227 1A5705101BE410E500874AF1 /* BlockSPI.h */, 7221 7228 37C21CAD1E994C0C0029D5F9 /* CorePredictionSPI.h */, … … 8232 8239 isa = PBXGroup; 8233 8240 children = ( 8241 572EBBD92538F6A1000552B3 /* AppAttestInternalSoftLink.h */, 8242 572EBBD82538F6A1000552B3 /* AppAttestInternalSoftLink.mm */, 8234 8243 57AC8F4E217FEED90055438C /* HidConnection.h */, 8235 8244 57AC8F4F217FEED90055438C /* HidConnection.mm */, … … 10809 10818 1AE286841C7F93860069AC4F /* APIWebsiteDataRecord.h in Headers */, 10810 10819 1A6563E51B7A8C50009CF787 /* APIWindowFeatures.h in Headers */, 10820 572EBBDB2538F6B6000552B3 /* AppAttestInternalSoftLink.h in Headers */, 10821 572EBBDD25392181000552B3 /* AppAttestSPI.h in Headers */, 10811 10822 074879B92373A90900F5678E /* AppKitSoftLink.h in Headers */, 10812 10823 F48D2A8521583A7E00C6752B /* AppKitSPI.h in Headers */, … … 12818 12829 99E7189A21F79D9E0055E975 /* _WKTouchEventGenerator.mm in Sources */, 12819 12830 2D92A784212B6AB100F493FD /* ActivityAssertion.cpp in Sources */, 12831 572EBBDA2538F6B4000552B3 /* AppAttestInternalSoftLink.mm in Sources */, 12820 12832 2D92A77B212B6A7100F493FD /* ArgumentCoders.cpp in Sources */, 12821 12833 2DEB1D2E2127473600933906 /* ArgumentCodersCF.cpp in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.