⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 248308 in webkit


Ignore:
Timestamp:
Aug 6, 2019, 12:54:43 PM (7 years ago)
Author:
jiewen_tan@apple.com
Message:

[WebAuthN] Enable LocalAuthenticator for macOS
https://bugs.webkit.org/show_bug.cgi?id=182772
<rdar://problem/43347920>

Reviewed by Brent Fulgham.

Source/WebKit:

This patch enables LocalAuthenticator for macOS. The majority
of this patch is to tweak macOS keychain to use the modern one.

  • Configurations/WebKit.xcconfig:
  • Platform/spi/Cocoa/DeviceIdentitySPI.h:
  • UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:

(WebKit::LocalAuthenticatorInternal::toVector):
(WebKit::LocalAuthenticator::makeCredential):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(WebKit::LocalAuthenticator::getAssertion):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):

  • UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:

(WebKit::LocalConnection::getUserConsent const):
(WebKit::LocalConnection::getAttestation const):

  • UIProcess/WebAuthentication/Cocoa/LocalService.mm:

(WebKit::LocalService::isAvailable):

  • UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:

(WebKit::MockLocalConnection::getAttestation const):

  • config.h:

Source/WTF:

  • wtf/Platform.h:

Adds HAVE_DEVICE_IDENTITY.

  • wtf/spi/cocoa/SecuritySPI.h:

Adds a SPI for telling macOS keychain to use the modern one.

Tools:

Add an entitlement file to WebKitTestRunner such that it can access
the modern macOS keychain.

  • WebKitTestRunner/Configurations/WebKitTestRunner.entitlements: Added.
  • WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig:
  • WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
  • WebKitTestRunner/cocoa/TestControllerCocoa.mm:

(WTR::TestController::addTestKeyToKeychain):
(WTR::TestController::cleanUpKeychain):
(WTR::TestController::keyExistsInKeychain):

LayoutTests:

Enable existing local authenticator tests for macOS. Since OpenSource bots
don't have the internal setting to include restricted entitlements, tests
will fail on OpenSource bots.

  • platform/mac-wk2/TestExpectations:
Location:
trunk
Files:
1 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r248306 r248308  
     12019-08-06  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthN] Enable LocalAuthenticator for macOS
     4        https://bugs.webkit.org/show_bug.cgi?id=182772
     5        <rdar://problem/43347920>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Enable existing local authenticator tests for macOS. Since OpenSource bots
     10        don't have the internal setting to include restricted entitlements, tests
     11        will fail on OpenSource bots.
     12
     13        * platform/mac-wk2/TestExpectations:
     14
    1152019-08-06  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r248283 r248308  
    904904webkit.org/b/189598 compositing/backing/backing-store-attachment-fill-forwards-animation.html [ Pass Failure ]
    905905
    906 # Skip local authenticator tests for mac now.
    907 http/wpt/webauthn/public-key-credential-create-failure-local.https.html [ Skip ]
    908 http/wpt/webauthn/public-key-credential-create-success-local.https.html [ Skip ]
    909 http/wpt/webauthn/public-key-credential-get-failure-local.https.html [ Skip ]
    910 http/wpt/webauthn/public-key-credential-get-success-local.https.html [ Skip ]
    911 # The following tests require PublicKeyCredential objects. We can only produce them via local authenticators now.
    912 http/wpt/credential-management/credentialscontainer-store-basics.https.html [ Skip ]
    913 http/wpt/webauthn/idl.https.html [ Skip ]
     906# Local authenticator tests require restricted keychain entitlement, which cannot be signed with ad hoc signing.
     907# Therefore, tests fail on OpenSource bots. They will be covered by Internal bots.
     908http/wpt/webauthn/public-key-credential-create-failure-local.https.html [ Failure ]
     909http/wpt/webauthn/public-key-credential-create-success-local.https.html [ Failure ]
     910http/wpt/webauthn/public-key-credential-get-failure-local.https.html [ Failure ]
     911http/wpt/webauthn/public-key-credential-get-success-local.https.html [ Failure ]
     912http/wpt/credential-management/credentialscontainer-store-basics.https.html [ Failure ]
     913http/wpt/webauthn/idl.https.html [ Failure ]
    914914
    915915webkit.org/b/183878 media/modern-media-controls/tracks-panel/tracks-panel-up-click-over-media-does-not-dimiss-media-controls-when-media-is-playing.html [ Pass Timeout ]
  • trunk/Source/WTF/ChangeLog

    r248294 r248308  
     12019-08-06  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthN] Enable LocalAuthenticator for macOS
     4        https://bugs.webkit.org/show_bug.cgi?id=182772
     5        <rdar://problem/43347920>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * wtf/Platform.h:
     10        Adds HAVE_DEVICE_IDENTITY.
     11        * wtf/spi/cocoa/SecuritySPI.h:
     12        Adds a SPI for telling macOS keychain to use the modern one.
     13
    1142019-08-06  Claudio Saavedra  <csaavedra@igalia.com>
    215
  • trunk/Source/WTF/wtf/Platform.h

    r248071 r248308  
    16251625#define USE_HIRAGINO_SANS_WORKAROUND 1
    16261626#endif
     1627
     1628#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR))
     1629#define HAVE_DEVICE_IDENTITY 1
     1630#endif
  • trunk/Source/WTF/wtf/spi/cocoa/SecuritySPI.h

    r247117 r248308  
    3131#include <Security/SecCertificatePriv.h>
    3232#include <Security/SecIdentityPriv.h>
     33#include <Security/SecItemPriv.h>
    3334#include <Security/SecKeyPriv.h>
    3435#include <Security/SecTask.h>
     
    6364
    6465SecSignatureHashAlgorithm SecCertificateGetSignatureHashAlgorithm(SecCertificateRef);
     66extern const CFStringRef kSecAttrNoLegacy;
    6567
    6668WTF_EXTERN_C_END
    6769
    68 #endif
     70#endif // USE(APPLE_INTERNAL_SDK)
    6971
    7072typedef struct __SecTask *SecTaskRef;
  • trunk/Source/WebKit/ChangeLog

    r248302 r248308  
     12019-08-06  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthN] Enable LocalAuthenticator for macOS
     4        https://bugs.webkit.org/show_bug.cgi?id=182772
     5        <rdar://problem/43347920>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        This patch enables LocalAuthenticator for macOS. The majority
     10        of this patch is to tweak macOS keychain to use the modern one.
     11
     12        * Configurations/WebKit.xcconfig:
     13        * Platform/spi/Cocoa/DeviceIdentitySPI.h:
     14        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
     15        (WebKit::LocalAuthenticatorInternal::toVector):
     16        (WebKit::LocalAuthenticator::makeCredential):
     17        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
     18        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
     19        (WebKit::LocalAuthenticator::getAssertion):
     20        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
     21        * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
     22        (WebKit::LocalConnection::getUserConsent const):
     23        (WebKit::LocalConnection::getAttestation const):
     24        * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
     25        (WebKit::LocalService::isAvailable):
     26        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
     27        (WebKit::MockLocalConnection::getAttestation const):
     28        * config.h:
     29
    1302019-08-06  Jer Noble  <jer.noble@apple.com>
    231
  • trunk/Source/WebKit/Configurations/WebKit.xcconfig

    r246892 r248308  
    173173WK_RELOCATABLE_FRAMEWORK_LDFLAGS_YES_macosx = -Wl,-not_for_dyld_shared_cache;
    174174
    175 WK_HAVE_DEVICE_IDENTITY = $(WK_HAVE_DEVICE_IDENTITY_$(PLATFORM_NAME));
     175WK_HAVE_DEVICE_IDENTITY = $(WK_HAVE_DEVICE_IDENTITY_$(WK_PLATFORM_NAME));
    176176WK_HAVE_DEVICE_IDENTITY_iphoneos = YES;
     177WK_HAVE_DEVICE_IDENTITY_macosx = $(WK_HAVE_DEVICE_IDENTITY$(WK_MACOS_1014));
     178WK_HAVE_DEVICE_IDENTITY_MACOS_SINCE_1014 = YES;
    177179
    178180WK_HAVE_URL_FORMATTING = $(WK_HAVE_URL_FORMATTING_$(WK_PLATFORM_NAME));
  • trunk/Source/WebKit/Platform/spi/Cocoa/DeviceIdentitySPI.h

    r237607 r248308  
    2828#if ENABLE(WEB_AUTHN)
    2929
    30 #if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR)
     30#if HAVE(DEVICE_IDENTITY)
    3131
    3232#if USE(APPLE_INTERNAL_SDK)
     
    5555#endif // USE(APPLE_INTERNAL_SDK)
    5656
    57 #endif // PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR)
     57#endif // HAVE(DEVICE_IDENTITY)
    5858
    5959#endif // ENABLE(WEB_AUTHN)
  • trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm

    r245638 r248308  
    4242#import <wtf/RunLoop.h>
    4343#import <wtf/Vector.h>
     44#import <wtf/spi/cocoa/SecuritySPI.h>
    4445#import <wtf/text/StringHash.h>
    4546
     
    5556const uint16_t credentialIdLength = 20;
    5657
    57 #if PLATFORM(IOS_FAMILY)
    5858static inline bool emptyTransportsOrContain(const Vector<AuthenticatorTransport>& transports, AuthenticatorTransport target)
    5959{
     
    7979    return result;
    8080}
    81 #endif // !PLATFORM(IOS_FAMILY)
    8281
    8382} // LocalAuthenticatorInternal
     
    9089void LocalAuthenticator::makeCredential()
    9190{
    92     // FIXME(182772)
    9391    using namespace LocalAuthenticatorInternal;
    9492    ASSERT(m_state == State::Init);
    9593    m_state = State::RequestReceived;
    9694
    97 #if PLATFORM(IOS_FAMILY)
    9895    // The following implements https://www.w3.org/TR/webauthn/#op-make-cred as of 5 December 2017.
    9996    // Skip Step 4-5 as requireResidentKey and requireUserVerification are enforced.
     
    123120            (id)kSecReturnAttributes: @YES,
    124121            (id)kSecMatchLimit: (id)kSecMatchLimitAll,
     122            (id)kSecAttrNoLegacy: @YES
    125123        };
    126124        CFTypeRef attributesArrayRef = nullptr;
     
    153151    };
    154152    m_connection->getUserConsent(
    155         "Allow " + requestData().creationOptions.rp.id + " to create a public key credential for " + requestData().creationOptions.user.name,
     153        "allow " + requestData().creationOptions.rp.id + " to create a public key credential for " + requestData().creationOptions.user.name,
    156154        WTFMove(callback));
    157 #endif // !PLATFORM(IOS_FAMILY)
    158155}
    159156
    160157void LocalAuthenticator::continueMakeCredentialAfterUserConsented(LocalConnection::UserConsent consent)
    161158{
    162     // FIXME(182772)
    163159    ASSERT(m_state == State::RequestReceived);
    164160    m_state = State::UserConsented;
    165161
    166 #if PLATFORM(IOS_FAMILY)
    167162    if (consent == LocalConnection::UserConsent::No) {
    168163        receiveRespond(ExceptionData { NotAllowedError, "Couldn't get user consent."_s });
     
    177172        (id)kSecAttrLabel: requestData().creationOptions.rp.id,
    178173        (id)kSecAttrApplicationTag: [NSData dataWithBytes:requestData().creationOptions.user.idVector.data() length:requestData().creationOptions.user.idVector.size()],
     174        (id)kSecAttrNoLegacy: @YES
    179175    };
    180176    OSStatus status = SecItemDelete((__bridge CFDictionaryRef)deleteQuery);
     
    193189    };
    194190    m_connection->getAttestation(requestData().creationOptions.rp.id, requestData().creationOptions.user.name, requestData().hash, WTFMove(callback));
    195 #endif // !PLATFORM(IOS_FAMILY)
    196191}
    197192
    198193void LocalAuthenticator::continueMakeCredentialAfterAttested(SecKeyRef privateKey, NSArray *certificates, NSError *error)
    199194{
    200     // FIXME(182772)
    201195    using namespace LocalAuthenticatorInternal;
    202196
     
    204198    m_state = State::Attested;
    205199
    206 #if PLATFORM(IOS_FAMILY)
    207200    if (error) {
    208201        LOG_ERROR("Couldn't attest: %@", error);
     
    228221    Vector<uint8_t> credentialId;
    229222    {
    230         // -rk is added by DeviceIdentity.Framework.
    231         String label = makeString(requestData().creationOptions.user.name, "@", requestData().creationOptions.rp.id, "-rk");
     223        // -rk-ucrt is added by DeviceIdentity.Framework.
     224        String label = makeString(requestData().creationOptions.user.name, "@", requestData().creationOptions.rp.id, "-rk-ucrt");
    232225        NSDictionary *credentialIdQuery = @{
    233226            (id)kSecClass: (id)kSecClassKey,
    234227            (id)kSecAttrKeyClass: (id)kSecAttrKeyClassPrivate,
    235228            (id)kSecAttrLabel: label,
    236             (id)kSecReturnAttributes: @YES
     229            (id)kSecReturnAttributes: @YES,
     230            (id)kSecAttrNoLegacy: @YES
    237231        };
    238232        CFTypeRef attributesRef = nullptr;
     
    252246            (id)kSecAttrKeyClass: (id)kSecAttrKeyClassPrivate,
    253247            (id)kSecAttrApplicationLabel: nsAttributes[(id)kSecAttrApplicationLabel],
     248            (id)kSecAttrNoLegacy: @YES
    254249        };
    255250        NSDictionary *updateParams = @{
     
    328323
    329324    receiveRespond(PublicKeyCredentialData { ArrayBuffer::create(credentialId.data(), credentialId.size()), true, nullptr, ArrayBuffer::create(attestationObject.data(), attestationObject.size()), nullptr, nullptr, nullptr, WTF::nullopt });
    330 #endif // !PLATFORM(IOS_FAMILY)
    331325}
    332326
    333327void LocalAuthenticator::getAssertion()
    334328{
    335     // FIXME(182772)
    336329    using namespace LocalAuthenticatorInternal;
    337330    ASSERT(m_state == State::Init);
    338331    m_state = State::RequestReceived;
    339332
    340 #if PLATFORM(IOS_FAMILY)
    341333    // The following implements https://www.w3.org/TR/webauthn/#op-get-assertion as of 5 December 2017.
    342334    // Skip Step 2 as requireUserVerification is enforced.
     
    356348        (id)kSecAttrLabel: requestData().requestOptions.rpId,
    357349        (id)kSecReturnAttributes: @YES,
    358         (id)kSecMatchLimit: (id)kSecMatchLimitAll
     350        (id)kSecMatchLimit: (id)kSecMatchLimitAll,
     351        (id)kSecAttrNoLegacy: @YES
    359352    };
    360353    CFTypeRef attributesArrayRef = nullptr;
     
    402395    };
    403396    NSData *idData = selectedCredentialAttributes[(id)kSecAttrApplicationTag];
    404     StringView idStringView { static_cast<const LChar*>([idData bytes]), static_cast<unsigned>([idData length]) };
     397    StringView idStringView { static_cast<const UChar*>([idData bytes]), static_cast<unsigned>([idData length]) };
    405398    m_connection->getUserConsent(
    406         makeString("Log into ", requestData().requestOptions.rpId, " with ", idStringView, '.'),
     399        makeString("log into ", requestData().requestOptions.rpId, " with ", idStringView),
    407400        (__bridge SecAccessControlRef)selectedCredentialAttributes[(id)kSecAttrAccessControl],
    408401        WTFMove(callback));
    409 #endif // PLATFORM(IOS_FAMILY)
    410402}
    411403
    412404void LocalAuthenticator::continueGetAssertionAfterUserConsented(LocalConnection::UserConsent consent, LAContext *context, const Vector<uint8_t>& credentialId, const Vector<uint8_t>& userhandle)
    413405{
    414     // FIXME(182772)
    415406    using namespace LocalAuthenticatorInternal;
    416407    ASSERT(m_state == State::RequestReceived);
    417408    m_state = State::UserConsented;
    418409
    419 #if PLATFORM(IOS_FAMILY)
    420410    if (consent == LocalConnection::UserConsent::No) {
    421411        receiveRespond(ExceptionData { NotAllowedError, "Couldn't get user consent."_s });
     
    438428            (id)kSecUseAuthenticationContext: context,
    439429            (id)kSecReturnRef: @YES,
     430            (id)kSecAttrNoLegacy: @YES
    440431        };
    441432        CFTypeRef privateKeyRef = nullptr;
     
    465456    // Step 13.
    466457    receiveRespond(PublicKeyCredentialData { ArrayBuffer::create(credentialId.data(), credentialId.size()), false, nullptr, nullptr, ArrayBuffer::create(authData.data(), authData.size()), ArrayBuffer::create(signature.data(), signature.size()), ArrayBuffer::create(userhandle.data(), userhandle.size()), WTF::nullopt });
    467 #endif // !PLATFORM(IOS_FAMILY)
    468458}
    469459
  • trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.mm

    r248190 r248308  
    4040void LocalConnection::getUserConsent(const String& reason, UserConsentCallback&& completionHandler) const
    4141{
    42     // FIXME(182772)
    43 #if PLATFORM(IOS_FAMILY)
    4442    auto context = adoptNS([allocLAContextInstance() init]);
    4543    auto reply = makeBlockPtr([completionHandler = WTFMove(completionHandler)] (BOOL success, NSError *error) mutable {
     
    5654    });
    5755    [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:reason reply:reply.get()];
    58 #endif
    5956}
    6057
    6158void LocalConnection::getUserConsent(const String& reason, SecAccessControlRef accessControl, UserConsentContextCallback&& completionHandler) const
    6259{
    63     // FIXME(182772)
    64 #if PLATFORM(IOS_FAMILY)
    6560    auto context = adoptNS([allocLAContextInstance() init]);
    6661    auto reply = makeBlockPtr([context, completionHandler = WTFMove(completionHandler)] (BOOL success, NSError *error) mutable {
     
    7772    });
    7873    [context evaluateAccessControl:accessControl operation:LAAccessControlOperationUseKeySign localizedReason:reason reply:reply.get()];
    79 #endif
    8074}
    8175
    8276void LocalConnection::getAttestation(const String& rpId, const String& username, const Vector<uint8_t>& hash, AttestationCallback&& completionHandler) const
    8377{
    84     // DeviceIdentity.Framework is not avaliable in iOS simulator.
    85 #if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR)
     78#if HAVE(DEVICE_IDENTITY)
    8679    // Apple Attestation
    8780    ASSERT(hash.size() <= 32);
     
    115108    // FIXME(183652): Reduce prompt for biometrics
    116109    DeviceIdentityIssueClientCertificateWithCompletion(dispatch_get_main_queue(), options, makeBlockPtr(WTFMove(completionHandler)).get());
    117 #endif
     110#endif // HAVE(DEVICE_IDENTITY)
    118111}
    119112
  • trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalService.mm

    r239689 r248308  
    4242}
    4343
     44// FIXME(rdar://problem/51048542)
    4445bool LocalService::isAvailable()
    4546{
    46 // FIXME(182772)
    47 #if !PLATFORM(IOS_FAMILY)
    48     return false;
    49 #else
     47    // FIXME(198176)
    5048    if (!WebCore::RuntimeEnabledFeatures::sharedFeatures().webAuthenticationLocalAuthenticatorEnabled())
    5149        return false;
     
    5856    }
    5957    return true;
    60 #endif
    6158}
    6259
  • trunk/Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.mm

    r236686 r248308  
    9393
    9494        // Mock what DeviceIdentity would do.
    95         String label = makeString(username, "@", rpId, "-rk");
     95        String label = makeString(username, "@", rpId, "-rk-ucrt");
    9696        NSDictionary* addQuery = @{
    9797            (id)kSecValueRef: (id)key.get(),
  • trunk/Tools/ChangeLog

    r248305 r248308  
     12019-08-06  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthN] Enable LocalAuthenticator for macOS
     4        https://bugs.webkit.org/show_bug.cgi?id=182772
     5        <rdar://problem/43347920>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Add an entitlement file to WebKitTestRunner such that it can access
     10        the modern macOS keychain.
     11
     12        * WebKitTestRunner/Configurations/WebKitTestRunner.entitlements: Added.
     13        * WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig:
     14        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
     15        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
     16        (WTR::TestController::addTestKeyToKeychain):
     17        (WTR::TestController::cleanUpKeychain):
     18        (WTR::TestController::keyExistsInKeychain):
     19
    1202019-08-06  Zhifei Fang  <zhifei_fang@apple.com>
    221
  • trunk/Tools/WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig

    r246282 r248308  
    3535EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*] = mac/*;
    3636INCLUDED_SOURCE_FILE_NAMES[sdk=iphone*] = mac/main.mm;
     37
     38CODE_SIGN_ENTITLEMENTS[sdk=macosx*] = Configurations/WebKitTestRunner.entitlements;
     39
     40CODE_SIGN_IDENTITY[sdk=macosx*] = $(CODE_SIGN_IDENTITY_$(USE_INTERNAL_SDK));
     41CODE_SIGN_IDENTITY_YES = $(WK_ENGINEERING_CODE_SIGN_IDENTITY);
  • trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj

    r247898 r248308  
    106106                5664A49A14326384008881BE /* TextInputController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5664A49814326384008881BE /* TextInputController.cpp */; };
    107107                5670B8281386FCA5002EB355 /* EventSenderProxy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5670B8271386FCA5002EB355 /* EventSenderProxy.mm */; };
    108                 570E75A82152DB4F00324B6E /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 570E75A42152DA2C00324B6E /* Security.framework */; };
     108                57A0062E22976EEB00AD08BD /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 570E75A42152DA2C00324B6E /* Security.framework */; };
     109                57A0062F22976EF800AD08BD /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 570E75A42152DA2C00324B6E /* Security.framework */; };
    109110                6510A78211EC643800410867 /* AHEM____.TTF in Resources */ = {isa = PBXBuildFile; fileRef = 6510A77711EC643800410867 /* AHEM____.TTF */; };
    110111                6510A78411EC643800410867 /* WebKitWeightWatcher100.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A77911EC643800410867 /* WebKitWeightWatcher100.ttf */; };
     
    324325                5670B8271386FCA5002EB355 /* EventSenderProxy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventSenderProxy.mm; sourceTree = "<group>"; };
    325326                570E75A42152DA2C00324B6E /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
     327                57A0062C22976E4D00AD08BD /* WebKitTestRunner.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = WebKitTestRunner.entitlements; sourceTree = "<group>"; };
    326328                583913D014335E95008307E5 /* JSAccessibilityController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAccessibilityController.cpp; sourceTree = "<group>"; };
    327329                583913D114335E95008307E5 /* JSAccessibilityController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAccessibilityController.h; sourceTree = "<group>"; };
     
    418420                        buildActionMask = 2147483647;
    419421                        files = (
    420                                 570E75A82152DB4F00324B6E /* Security.framework in Frameworks */,
     422                                57A0062F22976EF800AD08BD /* Security.framework in Frameworks */,
    421423                        );
    422424                        runOnlyForDeploymentPostprocessing = 0;
     
    427429                        files = (
    428430                                51058AD51D678820009A538C /* libWebCoreTestSupport.dylib in Frameworks */,
     431                                57A0062E22976EEB00AD08BD /* Security.framework in Frameworks */,
    429432                                51058AD61D678825009A538C /* WebKit.framework in Frameworks */,
    430433                        );
     
    807810                                BC25197111D15E61002EBC01 /* InjectedBundle.xcconfig */,
    808811                                A1B89B94221E026B00EB4CEA /* SDKVariant.xcconfig */,
     812                                57A0062C22976E4D00AD08BD /* WebKitTestRunner.entitlements */,
    809813                                A18510381B9ADF2200744AEB /* WebKitTestRunner.xcconfig */,
    810814                                9B0D132E2036D346008FC8FB /* WebKitTestRunnerApp-iOS.entitlements */,
  • trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm

    r246118 r248308  
    5252#import <WebKit/_WKUserContentExtensionStorePrivate.h>
    5353#import <wtf/MainThread.h>
     54#import <wtf/spi/cocoa/SecuritySPI.h>
    5455
    5556namespace WTR {
     
    330331void TestController::addTestKeyToKeychain(const String& privateKeyBase64, const String& attrLabel, const String& applicationTagBase64)
    331332{
    332     // FIXME(182772)
    333 #if PLATFORM(IOS_FAMILY)
    334333    NSDictionary* options = @{
    335334        (id)kSecAttrKeyType: (id)kSecAttrKeyTypeECSECPrimeRandom,
     
    349348        (id)kSecClass: (id)kSecClassKey,
    350349        (id)kSecAttrLabel: attrLabel,
    351         (id)kSecAttrApplicationTag: adoptNS([[NSData alloc] initWithBase64EncodedString:applicationTagBase64 options:NSDataBase64DecodingIgnoreUnknownCharacters]).get()
     350        (id)kSecAttrApplicationTag: adoptNS([[NSData alloc] initWithBase64EncodedString:applicationTagBase64 options:NSDataBase64DecodingIgnoreUnknownCharacters]).get(),
     351        (id)kSecAttrNoLegacy: @YES
    352352    };
    353353    OSStatus status = SecItemAdd((__bridge CFDictionaryRef)addQuery, NULL);
    354354    ASSERT_UNUSED(status, !status);
    355 #endif
    356355}
    357356
    358357void TestController::cleanUpKeychain(const String& attrLabel)
    359358{
    360     // FIXME(182772)
    361 #if PLATFORM(IOS_FAMILY)
    362359    NSDictionary* deleteQuery = @{
    363360        (id)kSecClass: (id)kSecClassKey,
    364         (id)kSecAttrLabel: attrLabel
     361        (id)kSecAttrLabel: attrLabel,
     362        (id)kSecAttrNoLegacy: @YES
    365363    };
    366364    SecItemDelete((__bridge CFDictionaryRef)deleteQuery);
    367 #endif
    368365}
    369366
    370367bool TestController::keyExistsInKeychain(const String& attrLabel, const String& applicationTagBase64)
    371368{
    372     // FIXME(182772)
    373 #if PLATFORM(IOS_FAMILY)
    374369    NSDictionary *query = @{
    375370        (id)kSecClass: (id)kSecClassKey,
     
    377372        (id)kSecAttrLabel: attrLabel,
    378373        (id)kSecAttrApplicationTag: adoptNS([[NSData alloc] initWithBase64EncodedString:applicationTagBase64 options:NSDataBase64DecodingIgnoreUnknownCharacters]).get(),
     374        (id)kSecAttrNoLegacy: @YES
    379375    };
    380376    OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, NULL);
     
    382378        return true;
    383379    ASSERT(status == errSecItemNotFound);
    384 #endif
    385380    return false;
    386381}
Note: See TracChangeset for help on using the changeset viewer.