Skip to content

Commit f35370a

Browse files
authored
Merge pull request #26 from cossacklabs/openssl-1.1.1v
Openssl 1.1.1v + improvements
2 parents 60271d8 + e937003 commit f35370a

File tree

9 files changed

+143
-25
lines changed

9 files changed

+143
-25
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ Pods
1818

1919
# Cossack Labs packaging
2020
output
21+
cocoapods/CLOpenSSL-XCF.podspec
22+

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ endif
1111
#===== Versioning ==============================================================
1212

1313
## OpenSSL version to build
14-
VERSION ?= 1.1.1u
14+
VERSION ?= 1.1.1v
1515

1616
## Extra version of the distributed package
1717
PACKAGE_VERSION ?= 1
1818
export PACKAGE_VERSION
1919

20-
MIN_IOS_SDK = 10.0
21-
MIN_OSX_SDK = 10.11
20+
MIN_IOS_SDK = 11.0
21+
MIN_OSX_SDK = 10.13
2222
export MIN_IOS_SDK MIN_OSX_SDK
2323

24-
BUILD_TARGETS += ios-sim-cross-i386 ios-sim-cross-x86_64
25-
BUILD_TARGETS += ios64-cross-arm64 ios-cross-armv7s ios-cross-armv7
24+
BUILD_TARGETS += ios-sim-cross-x86_64
25+
BUILD_TARGETS += ios64-cross-arm64
2626
BUILD_TARGETS += macos64-x86_64
2727

2828
# Automatically enable Apple Silicon support if running with Xcode 12.2+

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ let package = Package(
1414
targets: [
1515
.binaryTarget(name: "openssl",
1616
// update version in URL path
17-
url:"https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12101/openssl-static-xcframework.zip",
17+
url:"https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201/openssl-static-xcframework.zip",
1818
// Run from package directory:
1919
// swift package compute-checksum output/openssl-static-xcframework.zip
20-
checksum: "2a2023e200e3472cb6b06ca42a5903e66b567e223d8b540ccb3767fa61abf62f"),
20+
checksum: "a3363e4297428d2497c481791f6ac3c17c118b6829ee6246781efe0a3593ae16"),
2121
]
2222
)

RELEASING.md

Lines changed: 126 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,24 @@ How to update to newer OpenSSL version, build, and publish a release.
1515
Increment `PACKAGE_VERSION` if you are repackaging the same OpenSSL version.
1616
Otherwise, update `VERSION` to OpenSSL version and reset `PACKAGE_VERSION` to `1`.
1717

18+
```
19+
## OpenSSL version to build
20+
VERSION ?= 1.1.1v
21+
## Extra version of the distributed package
22+
PACKAGE_VERSION ?= 1
23+
```
24+
1825
Also update tarball checksums in [`build-libssl.sh`](build-libssl.sh).
26+
```
27+
# Default version in case no version is specified
28+
# Official checksums available at https://www.openssl.org/source/
29+
DEFAULTVERSION="1.1.1u"
30+
OPENSSL_CHECKSUMS="
31+
1.1.1k 892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
32+
1.1.1u e2f8d84b523eecd06c7be7626830370300fbcc15386bf5142d72758f6963ebc6
33+
1.1.1v d6697e2871e77238460402e9362d47d18382b15ef9f246aba6c7bd780d38a6b0
34+
"
35+
```
1936

2037
3. **Update platform configuration.**
2138

@@ -27,37 +44,87 @@ How to update to newer OpenSSL version, build, and publish a release.
2744
To build from scratch - remove output folder.
2845

2946
```shell
30-
make
47+
make clean && make
3148
```
3249

3350
This can take a while.
3451
Not only it builds the library, this also packages it,
3552
and updates the project specs.
3653

54+
Check the cocoapods/CLOpenSSL-XCF.podspec. It have to be created from podpec.template file with actual version, hash and filenames.
55+
56+
Note: semversioned number of framework is taken from ```frameworks/MacOSX/openssl.framework```.
57+
58+
3759
5. **Update SPM package settings**
3860

3961
Update [`Package.swift`](Package.swift) file with the new URL of the binary framework and its checksum:
4062

4163
```swift
4264
.binaryTarget(name: "openssl",
4365
// update version in URL path
44-
url:"https://github.com/cossacklabs/openssl-apple/releases/download/1.1.10701/openssl-static-xcframework.zip",
66+
url:"https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201/openssl-static-xcframework.zip",
4567
// Run from package directory:
4668
// swift package compute-checksum output/openssl-static-xcframework.zip
47-
checksum: "77b9a36297a2cade7bb6db5282570740a2af7b1e5083f126f46ca2671b14d73e"),
69+
checksum: "a3363e4297428d2497c481791f6ac3c17c118b6829ee6246781efe0a3593ae16"),
70+
```
71+
Remember: actual version you can see in output/version file. It is created by authors of the OpenSSL library.
72+
73+
6. **Update the Carthage package settings and prepare the copy of files**
74+
During the 'make' process, the scripts in the 'scripts' folder had to update the json files in the carthage folder. Check it out.
75+
76+
`cat carthage/openssl-dynamic-framework.json`
77+
```
78+
{
79+
"1.1.12201": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201/openssl-dynamic-xcframework.zip",
80+
"1.1.12101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12101/openssl-dynamic-xcframework.zip",
81+
"1.1.11101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.11101/openssl-dynamic-xcframework.zip",
82+
"1.1.10803": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.10803/openssl-dynamic-xcframework.zip",
83+
}
84+
```
85+
86+
`cat carthage/openssl-static-framework.json`
87+
```
88+
rad@Oleksiis-M1-2021 ~/g/p/t/openssl-apple (openssl-1.1.1v)> cat carthage/openssl-static-xcframework.json
89+
{
90+
"1.1.12201": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201/openssl-static-xcframework.zip",
91+
"1.1.12101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12101/openssl-static-xcframework.zip",
92+
"1.1.11101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.11101/openssl-static-xcframework.zip",
93+
"1.1.10803": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.10803/openssl-static-xcframework.zip",
94+
}
95+
```
96+
97+
Also carthage will use files with the name that contain ".xcframework". So, you need to copy files in output directory to corresponding names.
98+
`openssl-dynamic-xcframework.zip` to `openssl-dynamic.xcframework.zip`.
99+
And `openssl-static-xcframework.zip` to `openssl-static.xcframework.zip`
100+
You will upload these files later into the release.
101+
102+
7. **Cocoapods podspec**
103+
During the 'make' process scripts had to generate new podspec file from the template located in 'cocoapods' directory.
104+
So, you will see the new file: CLOpenSSL-XCF.podspec
105+
Check it out. You have to see newly created version and hash checksum in the body of the file.
48106
```
107+
openssl_version = "1.1.12201"
108+
XCFramework_archive_hash = "bc9d20b7e4369b3cec2f30115e455f610c9d61aefc569676805b006d83e77944"
109+
```
110+
111+
You can compare the hash with the result of command `swift package compute-checksum output/openssl-dynamic-xcframework.zip`
112+
It should be equal.
113+
openssl_version have to be equal to `cat output/version`
114+
115+
8. **Commit, tag, push the release.**
49116

50-
6. **Commit, tag, push the release.**
117+
Commit the changes. Changes must contain new version settings, SPM, Carthage, and Cocoapods updates. Optionally, other files.
51118

52-
Tag should be in a semver format.
119+
Tag should be in a semver format. Do not add cocoapods/CLOpenSSL-XCF.podspec to the git. It is generated every time.
53120

54121
```shell
55122
git add carthage
56123
git add Package.swift
57-
git commit -S -e -m "OpenSSL 1.1.1g"
58-
git tag -s -e -m "OpenSSL 1.1.1g" 1.1.10701
124+
git commit -S -e -m "OpenSSL 1.1.1v"
125+
git tag -s -e -m "OpenSSL 1.1.1v" 1.1.12201
59126
git push origin cossacklabs # Push the branch
60-
git push origin 1.1.10701 # Push the tag
127+
git push origin 1.1.12201 # Push the tag
61128
```
62129

63130
Make will remind you how to do this.
@@ -67,23 +134,24 @@ How to update to newer OpenSSL version, build, and publish a release.
67134
Congratulations!
68135
You have just published broken Carthage and SPM packages :)
69136

70-
7. **Publish GitHub release with binary framework files.**
137+
9. **Publish GitHub release with binary framework files.**
71138

72139
Go to GitHub release page for the tag:
73140

74-
https://github.com/cossacklabs/openssl-apple/releases/tag/1.1.107
141+
https://github.com/cossacklabs/openssl-apple/releases/tag/1.1.12201
75142

76-
press **Edit tag** and upload `*.zip` packages from `output` directory.
143+
press **Edit tag** and upload `*.zip` packages from `output` directory. Do not forget to upload also .xcframework.zip files too. It is important for carthage binary prebuilt scheme.
77144

78145
Also, describe the release, press the **Publish release** when done.
79146

80147
Congratulations!
81148
You should have fixed the Carthage and SPM packages with this.
82149

83-
8. **Publish podspec.**
150+
10. **Publish podspec.**
84151

85152
```shell
86-
pod trunk push cocoapods/CLOpenSSL.podspec
153+
pod spec lint
154+
pod trunk push cocoapods/CLOpenSSL-XCF.podspec
87155
```
88156

89157
This lints the podspec before publishing it.
@@ -94,4 +162,49 @@ How to update to newer OpenSSL version, build, and publish a release.
94162

95163
Actually, you have published all of the OpenSSL.
96164
Now is the time to go check if it *actually* works.
165+
97166
You can use [Themis](https://github.com/cossacklabs/themis) for that.
167+
168+
11. **Test the CLOpenSSL-XCF release**
169+
170+
##### SPM
171+
172+
1. Create a new Xcode project.
173+
2. Add the package from the URL: https://github.com/cossacklabs/openssl-apple
174+
3. Select the exact version (Which you released recently)
175+
4. Compile and run project (Build, Archive)
176+
177+
##### Carthage
178+
1. Create a new Xcode project
179+
2. Create Cartfile near the .xcodeproj or .xcworkspace file
180+
3. Add similar content
181+
```
182+
“github "cossacklabs/openssl-apple" ~> 1.1.12201
183+
```
184+
185+
Run
186+
187+
```
188+
carthage update --use-xcframeworks
189+
```
190+
191+
4. Drag the downloaded `.xcframework` bundles from `Carthage/Build` into the "Frameworks and Libraries" section of your application’s Xcode project.
192+
193+
##### Cocoapods
194+
1. Create new Xcode project
195+
2. run pod init from the root of the project
196+
3. Add
197+
198+
```bash
199+
pod 'CLOpenSSL-XCF'
200+
```
201+
202+
4. Run
203+
204+
```bash
205+
pod install
206+
```
207+
208+
Open .xcworkspace file and run test the project
209+
210+

build-libssl.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ set -u
2525
# SCRIPT DEFAULTS
2626

2727
# Default version in case no version is specified
28-
DEFAULTVERSION="1.1.1u"
28+
DEFAULTVERSION="1.1.1v"
2929

3030
# Default (=full) set of targets (OpenSSL >= 1.1.1) to build
3131
DEFAULTTARGETS=`cat <<TARGETS
@@ -489,6 +489,7 @@ OPENSSL_CHECKSUMS="
489489
1.1.1h 5c9ca8774bd7b03e5784f26ae9e9e6d749c9da2438545077e6b3d755a06595d9
490490
1.1.1k 892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
491491
1.1.1u e2f8d84b523eecd06c7be7626830370300fbcc15386bf5142d72758f6963ebc6
492+
1.1.1v d6697e2871e77238460402e9362d47d18382b15ef9f246aba6c7bd780d38a6b0
492493
"
493494
checksum_checked=false
494495
while read version expectedSHA256; do

carthage/openssl-dynamic-xcframework.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"1.1.12201": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201/openssl-dynamic-xcframework.zip",
23
"1.1.12101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12101/openssl-dynamic-xcframework.zip",
34
"1.1.11101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.11101/openssl-dynamic-xcframework.zip",
45
"1.1.10803": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.10803/openssl-dynamic-xcframework.zip",

carthage/openssl-static-xcframework.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"1.1.12201": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12201/openssl-static-xcframework.zip",
23
"1.1.12101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.12101/openssl-static-xcframework.zip",
34
"1.1.11101": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.11101/openssl-static-xcframework.zip",
45
"1.1.10803": "https://github.com/cossacklabs/openssl-apple/releases/download/1.1.10803/openssl-static-xcframework.zip",

config/20-all-platforms.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ my %targets = ();
107107
# Catalyst (x86_64)
108108
"mac-catalyst-x86_64" => {
109109
inherit_from => [ "darwin64-x86_64-cc", "mac-catalyst-base" ],
110-
cflags => add("-target x86_64-apple-ios13.0-macabi -mios-version-min=13.0"),
110+
cflags => add("-target x86_64-apple-ios14.0-macabi -mios-version-min=14.0"),
111111
sys_id => "MacOSX",
112112
},
113113
# Catalyst (arm64)
114114
"mac-catalyst-arm64" => {
115115
inherit_from => [ "darwin64-arm64-cc", "mac-catalyst-base" ],
116-
cflags => add("-target arm64-apple-ios13.0-macabi -mios-version-min=13.0"),
116+
cflags => add("-target arm64-apple-ios14.0-macabi -mios-version-min=14.0"),
117117
sys_id => "MacOSX",
118118
},
119119

scripts/update-specs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
set -eu
1616

1717
OUTPUT=${OUTPUT:-output}
18-
MIN_IOS_SDK=${MIN_IOS_SDK:-8.0}
19-
MIN_OSX_SDK=${MIN_OSX_SDK:-10.9}
18+
MIN_IOS_SDK=${MIN_IOS_SDK:-11.0}
19+
MIN_OSX_SDK=${MIN_OSX_SDK:-10.13}
2020

2121
# GitHub repository where build script and binaries are hosted
2222
GITHUB_REPO="https://github.com/cossacklabs/openssl-apple"

0 commit comments

Comments
 (0)