Skip to content

Commit 6795b62

Browse files
yim-leeMaxDesiatov
andauthored
Update to swift-crypto 2.4.1 (#6431)
Motivation: swift-crypto 2.4.1 includes updates in BoringSSL that cause `Unsafe*Pointer<EVP_PKEY>` become `OpaquePointer` and without this code adjustment SwiftPM fails to build with `error: cannot find type 'EVP_PKEY' in scope`. Modifications: - Update dependency from 2.4.0 to 2.4.1 - Replace `Unsafe*Pointer<EVP_PKEY>` with `OpaquePointer`. Co-authored-by: Max Desiatov <[email protected]>
1 parent ce9f5b2 commit 6795b62

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
751751
// dependency version changes here with those projects.
752752
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "1.2.2")),
753753
.package(url: "https://github.com/apple/swift-driver.git", branch: relatedDependenciesBranch),
754-
.package(url: "https://github.com/apple/swift-crypto.git", exact: "2.4.0"),
754+
.package(url: "https://github.com/apple/swift-crypto.git", .upToNextMinor(from: "2.4.1")),
755755
.package(url: "https://github.com/apple/swift-system.git", .upToNextMinor(from: "1.1.1")),
756756
.package(url: "https://github.com/apple/swift-collections.git", .upToNextMinor(from: "1.0.1")),
757757
.package(url: "https://github.com/apple/swift-certificates.git", .upToNextMinor(from: "0.1.0")),

Sources/PackageCollectionsSigning/Certificate/Certificate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ final class BoringSSLCertificate {
184184
return try self.keyType(of: key)
185185
}
186186

187-
private func keyType(of key: UnsafeMutablePointer<EVP_PKEY>) throws -> KeyType {
187+
private func keyType(of key: OpaquePointer) throws -> KeyType {
188188
let algorithm = CCryptoBoringSSL_EVP_PKEY_id(key)
189189

190190
switch algorithm {

Sources/PackageCollectionsSigning/Key/Key+RSA.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ final class BoringSSLRSAPublicKey: PublicKey, BoringSSLKey {
148148
/// `data` should be in the PKCS #1 format
149149
init(data: Data) throws {
150150
let bytes = data.copyBytes()
151-
let key = try bytes.withUnsafeBufferPointer { (ptr: UnsafeBufferPointer<UInt8>) throws -> UnsafeMutablePointer<EVP_PKEY> in
151+
let key = try bytes.withUnsafeBufferPointer { ptr in
152152
var pointer = ptr.baseAddress
153153
guard let key = CCryptoBoringSSL_d2i_PublicKey(EVP_PKEY_RSA, nil, &pointer, numericCast(data.count)) else {
154154
throw BoringSSLKeyError.failedToLoadKeyFromBytes

0 commit comments

Comments
 (0)