Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2b31bb8e06289efd1c5474fa30423980e708038a
https://github.com/WebKit/WebKit/commit/2b31bb8e06289efd1c5474fa30423980e708038a
Author: Richard Robinson <[email protected]>
Date: 2026-03-27 (Fri, 27 Mar 2026)
Changed paths:
M Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
M Source/WebCore/PAL/pal/PALSwift/CryptoKitShim.swift
M Source/WebCore/PAL/pal/crypto/CryptoAlgorithmAESGCMCocoa.cpp
M Source/WebCore/PAL/pal/crypto/CryptoAlgorithmAESKWCocoaBridging.cpp
M Source/WebCore/PAL/pal/crypto/CryptoAlgorithmEd25519CocoaBridging.cpp
M Source/WebCore/PAL/pal/crypto/CryptoAlgorithmX25519CocoaBridging.cpp
M Source/WebCore/PAL/pal/crypto/CryptoTypes.h
A Source/WebCore/PAL/pal/crypto/PlatformECKey.cpp
A Source/WebCore/PAL/pal/crypto/PlatformECKey.h
M Source/WebCore/PAL/pal/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp
M Source/WebCore/PAL/pal/module.modulemap
M Source/WebCore/crypto/cocoa/CryptoAlgorithmECDHCocoa.cpp
M Source/WebCore/crypto/cocoa/CryptoAlgorithmECDSACocoa.cpp
M Source/WebCore/crypto/cocoa/CryptoKeyECCocoa.cpp
M Source/WebCore/crypto/cocoa/CryptoKeyOKPCocoa.cpp
M Source/WebCore/crypto/keys/CryptoKeyEC.cpp
M Source/WebCore/crypto/keys/CryptoKeyEC.h
Log Message:
-----------
[Swift in WebKit] Non-PAL targets should not access the internal PAL Swift
bridging header (part 5)
https://bugs.webkit.org/show_bug.cgi?id=310776
rdar://173383749
Reviewed by Abrar Rahman Protyasha.
Sink the ECKey implementation details into PAL from WebCore.
* Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj:
* Source/WebCore/PAL/pal/PALSwift/CryptoKitShim.swift:
(ECKey.importX963Pub(_:curve:)):
(ECKey.importCompressedPub(_:curve:)):
(ECKey.importX963Private(_:curve:)):
(ECImportReturnValue.errorCode): Deleted.
(ECImportReturnValue.key): Deleted.
- Remove the concept of a "ECImportReturnValue" since it is not needed; a
simple optional suffices and is much simpler.
- Remove the custom Swift ECCurve type in favor of the agnostic PAL ECCurve type
* Source/WebCore/PAL/pal/crypto/CryptoAlgorithmAESGCMCocoa.cpp:
* Source/WebCore/PAL/pal/crypto/CryptoAlgorithmAESKWCocoaBridging.cpp:
* Source/WebCore/PAL/pal/crypto/CryptoAlgorithmEd25519CocoaBridging.cpp:
* Source/WebCore/PAL/pal/crypto/CryptoAlgorithmX25519CocoaBridging.cpp:
* Source/WebCore/PAL/pal/crypto/CryptoTypes.h:
- Add a `ECNamedCurve` type and use it from both PAL and WebCore
* Source/WebCore/PAL/pal/crypto/PlatformECKey.cpp: Added.
(PAL::Crypto::PlatformECKey::PlatformECKey):
(PAL::Crypto::PlatformECKey::deriveBits const):
(PAL::Crypto::PlatformECKey::sign const):
(PAL::Crypto::PlatformECKey::doVerify const):
(PAL::Crypto::PlatformECKey::toPub const):
(PAL::Crypto::PlatformECKey::exportX963Pub const):
(PAL::Crypto::PlatformECKey::exportX963Private const):
(PAL::Crypto::PlatformECKey::importX963Pub):
(PAL::Crypto::PlatformECKey::importX963Private):
(PAL::Crypto::PlatformECKey::importCompressedPub):
* Source/WebCore/PAL/pal/crypto/PlatformECKey.h: Copied from
Source/WebCore/PAL/pal/crypto/CryptoTypes.h.
Introduce a `PlatformECKey` C++ type to be used by WebCore, which hides the
Swift implementation details using the Pimpl idiom
and fixes the layering violation.
* Source/WebCore/PAL/pal/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp:
- Remove some pragma diagnostic ignores now that it doesn't result in an error
to do so.
* Source/WebCore/PAL/pal/module.modulemap:
- Silly workaround for incremental build issues
* Source/WebCore/crypto/cocoa/CryptoAlgorithmECDHCocoa.cpp:
* Source/WebCore/crypto/cocoa/CryptoAlgorithmECDSACocoa.cpp:
(WebCore::verifyECDSACryptoKit):
* Source/WebCore/crypto/cocoa/CryptoKeyECCocoa.cpp:
(WebCore::toPlatformKey):
(WebCore::CryptoKeyEC::platformGeneratePair):
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::CryptoKeyEC::platformImportSpki):
(WebCore::CryptoKeyEC::platformImportPkcs8):
(WebCore::namedCurveToCryptoKitCurve):
* Source/WebCore/crypto/cocoa/CryptoKeyOKPCocoa.cpp:
* Source/WebCore/crypto/keys/CryptoKeyEC.cpp:
* Source/WebCore/crypto/keys/CryptoKeyEC.h:
- Remove includes of the generated header
- Use the new PlatformECKey type instead
Canonical link: https://commits.webkit.org/310102@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications