Skip to content

Commit f63022a

Browse files
authored
Update to swift-crypto 2.4.1 (#6433)
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`.
1 parent 717cca3 commit f63022a

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
@@ -738,7 +738,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
738738
// dependency version changes here with those projects.
739739
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "1.2.2")),
740740
.package(url: "https://github.com/apple/swift-driver.git", branch: relatedDependenciesBranch),
741-
.package(url: "https://github.com/apple/swift-crypto.git", exact: "2.4.0"),
741+
.package(url: "https://github.com/apple/swift-crypto.git", .upToNextMinor(from: "2.4.1")),
742742
.package(url: "https://github.com/apple/swift-system.git", .upToNextMinor(from: "1.1.1")),
743743
.package(url: "https://github.com/apple/swift-collections.git", .upToNextMinor(from: "1.0.1")),
744744
.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)