Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 74b4c68442b679c01593c67966182f01e0650948
      
https://github.com/WebKit/WebKit/commit/74b4c68442b679c01593c67966182f01e0650948
  Author: Adrian Taylor <[email protected]>
  Date:   2026-08-21 (Fri, 21 Aug 2026)

  Changed paths:
    M Source/WebCore/PAL/pal/crypto/CryptoEDKeyBridging.cpp
    M Source/WebCore/PAL/pal/crypto/CryptoEDKeyBridging.h
    M Source/WebCore/PAL/pal/crypto/PlatformECKey.cpp
    M Source/WebCore/PAL/pal/crypto/PlatformECKey.h
    M Source/WebCore/crypto/cocoa/CryptoAlgorithmECDSACocoa.cpp
    M Source/WebCore/crypto/cocoa/CryptoKeyECCocoa.cpp
    M Source/WebCore/crypto/cocoa/CryptoKeyOKPCocoa.cpp

  Log Message:
  -----------
  Borrow vectors wherever possible in PAL Crypto
https://bugs.webkit.org/show_bug.cgi?id=321179
rdar://184230601

Reviewed by Richard Robinson.

We're building primitives to allow ranges of bytes to be passed safely from C++
to
Swift. Swift will now crash cleanly if a C++ vector is structurally modified
while its data is in scope in Swift.

This only works for Vectors, not raw spans. Modify PAL crypto to pass vectors
around instead of spans wherever possible, so that we get the benefit of this
dynamic lifetime enforcement.

* Source/WebCore/PAL/pal/crypto/CryptoEDKeyBridging.cpp:
(PAL::Crypto::EdKey::privateToPublic):
(PAL::Crypto::EdKey::privateToPublicKeyAgreement):
(PAL::Crypto::EdKey::validateKeyPair):
(PAL::Crypto::EdKey::validateKeyPairKeyAgreement):
* Source/WebCore/PAL/pal/crypto/CryptoEDKeyBridging.h:
* Source/WebCore/PAL/pal/crypto/PlatformECKey.cpp:
(PAL::Crypto::PlatformECKey::sign const):
(PAL::Crypto::PlatformECKey::doVerify const):
(PAL::Crypto::PlatformECKey::importX963Pub):
(PAL::Crypto::PlatformECKey::importX963Private):
(PAL::Crypto::PlatformECKey::importCompressedPub):
* Source/WebCore/PAL/pal/crypto/PlatformECKey.h:
*
Source/WebCore/crypto/cocoa/CryptoAlgorithmECDSACocoa.cpp:
(WebCore::signECDSACryptoKit):
(WebCore::verifyECDSACryptoKit):
* Source/WebCore/crypto/cocoa/CryptoKeyECCocoa.cpp:
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::CryptoKeyEC::platformImportSpki):
(WebCore::CryptoKeyEC::platformImportPkcs8):
* Source/WebCore/crypto/cocoa/CryptoKeyOKPCocoa.cpp:
(WebCore::CryptoKeyOKP::platformGeneratePair):
(WebCore::CryptoKeyOKP::platformCheckPairedKeys):
(WebCore::CryptoKeyOKP::generateJwkX const):

Canonical link: 
https://flagged.apple.com:443/proxy?t2=Dz6r7r9pq9&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzE5NTg3QG1haW4=&emid=e47e3700-15ea-4979-8e75-f8b45e44838c&c=11



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to