This patch has 3 parts: a commit to update the vendoring script, a
commit that contains the results of running the script, and then a fixup
for the API breaks we got.
* Update BoringSSL to 25773430c07075a368416c3646fa4b07daf4968a
* Clean up the use of the X509 pointer
Motivation:
BoringSSL has begun opaquifying their X.509 library. This unfortunately
manifests as source code changes in Swift due to the way OpaquePointer
behaves. As a result, we need to change the places that held an X.509
pointer directly.
While we're here, we've been playing a bit fast-and-loose with the
lifetime of owned pointers. We should take this opportunity to clean
things up and be a bit better behaved.
Modifications:
- Replace the X509 pointers with OpaquePointer
- Use scoped access to the X.509 access outside the NIOSSLCertificate
class.
Result:
Code compiles with better pointer hygeine.
* Update vendoring script to fix a missing includeo
Motivation:
The openssl/evp.h header was missing causing compilation to fail.
In addition, a previously missing header is now included by BoringSSL.
Modifications:
- Update the fix import line to fix the new missing header.
Result:
BoringSSL can be vendored using our script.
* Update BoringSSL to 4a265be4d931e35f0d108040c94d37bb49827948.
Motivation:
Our scripts have code to catch the functions that are used with STACK_OF
and LHASH_OF data structures in BoringSSL in order to namespace them.
Sadly, some declarations were falling through the cracks: we missed some
LHASH_OF functions used internally, and we missed the
DEFINE_NAMED_STACK_OF macro used for a new C++ data type.
Modifications:
- Improved these scripts to catch more cases.
- Updated BoringSSL to 9806ae005b3085683a2fcf2953e4170893e0973d.
Result:
Fewer exported symbols from BoringSSL.
Motivation:
When including an xcodeproj generated by SwiftPM (which builds
CNIOBoringSSL) into an xcodeproj which wasn't generated by SwiftPM it
doesn't know about the correct header paths.
Modifications:
Update the vendor-boringssl script to:
- Namespace BoringSSL with CNIOBoringSSL_ instead of CNIOBoringSSL/
- Create an umbrealla CNIOBoringSSL header
- Apply a patch to replace inttypes.h with sys/types.h in bn.h
- Apply a patch to conditionally include arm_arch.h
BoringSSL was also updated to: ae223d6138807a13006342edfeef32e813246b39
Result:
Non-SwiftPM xcodeproj's can build a SwiftPM generated xcodeproj
which includes CNIOBoringSSL.
Motivation:
Due to the way SwiftPM builds projects it's possible for our
BoringSSL header files to clash with other people's OpenSSL header
files. That leads to build errors and sadness.
Modifications:
- Updated the BoringSSL vendor script to move all header files.
- Updated script to point C files at new header files.
- Brought in new BoringSSL version.
After your change, what will change:
Happier users
Motivation:
Requiring the system's SSL library was a constant source of problems.
Modifications:
This is the patch that transitions swift-nio-ssl to use BoringSSL, as discussed in [the Swift forums](https://forums.swift.org/t/rfc-moving-swiftnio-ssl-to-boringssl/18280).
Result:
Easier SSL support