Skip to content

Commit 98f7db1

Browse files
authored
Merge pull request #5 from apple/main
Update to latest commits from `main`
2 parents ed0dac7 + 735a29c commit 98f7db1

File tree

399 files changed

+62534
-38841
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

399 files changed

+62534
-38841
lines changed

.github/release.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
changelog:
2+
categories:
3+
- title: SemVer Major
4+
labels:
5+
- ⚠️ semver/major
6+
- title: SemVer Minor
7+
labels:
8+
- semver/minor
9+
- title: SemVer Patch
10+
labels:
11+
- semver/patch
12+
- title: Other Changes
13+
labels:
14+
- semver/none

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,15 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
4848
find_package(Foundation CONFIG)
4949
endif()
5050

51+
include(FetchContent)
52+
find_package(SwiftASN1 CONFIG)
53+
if(NOT SwiftASN1_FOUND)
54+
message("-- Vending swift-asn1")
55+
FetchContent_Declare(ASN1
56+
GIT_REPOSITORY https://github.com/apple/swift-asn1
57+
GIT_TAG 1.1.0)
58+
FetchContent_MakeAvailable(ASN1)
59+
endif()
60+
5161
add_subdirectory(Sources)
5262
add_subdirectory(cmake/modules)

Package.swift

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.8
1+
// swift-tools-version:5.9
22
//===----------------------------------------------------------------------===//
33
//
44
// This source file is part of the SwiftCrypto open source project
@@ -20,7 +20,7 @@
2020
// Sources/CCryptoBoringSSL directory. The source repository is at
2121
// https://boringssl.googlesource.com/boringssl.
2222
//
23-
// BoringSSL Commit: dbad745811195c00b729efd0ee0a09b7d9fce1d2
23+
// BoringSSL Commit: 76968bb3d53982560bcf08bcd0ba3e1865fe15cd
2424

2525
import PackageDescription
2626

@@ -57,6 +57,18 @@ if development {
5757
]
5858
}
5959

60+
// This doesn't work when cross-compiling: the privacy manifest will be included in the Bundle and
61+
// Foundation will be linked. This is, however, strictly better than unconditionally adding the
62+
// resource.
63+
#if canImport(Darwin)
64+
let privacyManifestExclude: [String] = []
65+
let privacyManifestResource: [PackageDescription.Resource] = [.copy("PrivacyInfo.xcprivacy")]
66+
#else
67+
// Exclude on other platforms to avoid build warnings.
68+
let privacyManifestExclude: [String] = ["PrivacyInfo.xcprivacy"]
69+
let privacyManifestResource: [PackageDescription.Resource] = []
70+
#endif
71+
6072
let package = Package(
6173
name: "swift-crypto",
6274
platforms: [
@@ -72,11 +84,13 @@ let package = Package(
7284
.library(name: "CCryptoBoringSSL", type: .static, targets: ["CCryptoBoringSSL"]),
7385
MANGLE_END */
7486
],
75-
dependencies: [],
87+
dependencies: [
88+
.package(url: "https://github.com/apple/swift-asn1.git", from: "1.2.0")
89+
],
7690
targets: [
7791
.target(
7892
name: "CCryptoBoringSSL",
79-
exclude: [
93+
exclude: privacyManifestExclude + [
8094
"hash.txt",
8195
"include/boringssl_prefix_symbols_nasm.inc",
8296
"CMakeLists.txt",
@@ -88,9 +102,7 @@ let package = Package(
88102
"crypto/bio/socket_helper.c",
89103
"crypto/bio/socket.c"
90104
],
91-
resources: [
92-
.copy("PrivacyInfo.xcprivacy"),
93-
],
105+
resources: privacyManifestResource,
94106
cSettings: [
95107
// These defines come from BoringSSL's build system
96108
.define("_HAS_EXCEPTIONS", to: "0", .when(platforms: [Platform.windows])),
@@ -107,26 +119,22 @@ let package = Package(
107119
.target(
108120
name: "CCryptoBoringSSLShims",
109121
dependencies: ["CCryptoBoringSSL"],
110-
exclude: [
122+
exclude: privacyManifestExclude + [
111123
"CMakeLists.txt"
112124
],
113-
resources: [
114-
.copy("PrivacyInfo.xcprivacy"),
115-
]
125+
resources: privacyManifestResource
116126
),
117127
.target(
118128
name: "Crypto",
119129
dependencies: dependencies,
120-
exclude: [
130+
exclude: privacyManifestExclude + [
121131
"CMakeLists.txt",
122132
"AEADs/Nonces.swift.gyb",
123133
"Digests/Digests.swift.gyb",
124134
"Key Agreement/ECDH.swift.gyb",
125135
"Signatures/ECDSA.swift.gyb",
126136
],
127-
resources: [
128-
.copy("PrivacyInfo.xcprivacy"),
129-
],
137+
resources: privacyManifestResource,
130138
swiftSettings: swiftSettings + [.define("MODULE_IS_CRYPTO")]
131139
),
132140
.target(
@@ -135,14 +143,13 @@ let package = Package(
135143
"CCryptoBoringSSL",
136144
"CCryptoBoringSSLShims",
137145
"CryptoBoringWrapper",
138-
"Crypto"
146+
"Crypto",
147+
.product(name: "SwiftASN1", package: "swift-asn1")
139148
],
140-
exclude: [
149+
exclude: privacyManifestExclude + [
141150
"CMakeLists.txt",
142151
],
143-
resources: [
144-
.copy("PrivacyInfo.xcprivacy"),
145-
],
152+
resources: privacyManifestResource,
146153
swiftSettings: swiftSettings
147154
),
148155
.target(
@@ -151,12 +158,10 @@ let package = Package(
151158
"CCryptoBoringSSL",
152159
"CCryptoBoringSSLShims"
153160
],
154-
exclude: [
161+
exclude: privacyManifestExclude + [
155162
"CMakeLists.txt",
156163
],
157-
resources: [
158-
.copy("PrivacyInfo.xcprivacy"),
159-
]
164+
resources: privacyManifestResource
160165
),
161166
.executableTarget(name: "crypto-shasum", dependencies: ["Crypto"]),
162167
.testTarget(

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ Swift Crypto | Minimum Swift Version
117117
`2.2.0 ..< 2.4.2` | 5.5
118118
`2.4.2 ..< 3.1.0` | 5.6
119119
`3.1.0 ..< 3.3.0` | 5.7
120-
`3.3.0 ...` | 5.8
120+
`3.3.0 ..< 3.8.0` | 5.8
121+
`3.8.0 ...` | 5.9
121122

122123
### Compatibility
123124

0 commit comments

Comments
 (0)