This change prepares swift-crypto for use on Windows with CMake and also
the Package.swift for use in the Swift toolchain CI system.
### Checklist
- [X] I've run tests to see all new and existing tests pass
- [X] I've followed the code style of the rest of the project
- [X] I've read the [Contribution Guidelines](CONTRIBUTING.md)
- [X] I've updated the documentation if necessary
#### If you've made changes to `gyb` files
- [X] I've run `.script/generate_boilerplate_files_with_gyb` and
included updated generated files in a commit of this pull request
### Motivation:
Upgrading swift-crypto from an older version requires that Windows works
properly with CMake, and also SwiftPM.
### Modifications:
Modify the CMakeLists.txt files and the generator script so that it
conditionally adds assembly files for non-Windows platforms. Prepare the
Package.swift file for use in Swift CI pipelines, by consulting an
environment to either use the absolute URL, or a prepared version of the
swift-asn1 dependency.
### Result:
After this change it should be possible to build with the newest
swift-crypto in the Swift CI system.
Update both the CMakeLists.txt for CCryptoBoringSSL and the
CMakeLists.txt generator so that it can add platform-independent
assembly files.
### Checklist
- [X] I've run tests to see all new and existing tests pass
- [X] I've followed the code style of the rest of the project
- [X] I've read the [Contribution Guidelines](CONTRIBUTING.md)
- [X] I've updated the documentation if necessary
#### If you've made changes to `gyb` files
- [X] I've run `./scripts/generate_boilerplate_files_with_gyb` and
included updated generated files in a commit of this pull request
### Motivation:
There are downstream linker failures due to missing symbols from certain
platform neutral assembly files.
### Modifications:
The `scripts/update-cmake-lists.sh` has an updated find expression to
discover platform-independent assembly files and includes them in the
`CMakeLists.txt` files.
### Result:
There will be more symbols included from third-parties such as
BoringSSL.
## Motivation
As part of the Github Actions CI migration we held off enabling the
format check and moving to the same formatting rules as Swift NIO, but
we'd like to do that now.
## Modifications
- Add a script to generate (and update) the `.swiftformatignore` file
since this repo only wants to format a specific set of files matching a
pattern.
- Generate and commit the `.swiftformatignore` file.
- Run the fomatter and commit the results.
- Additional commits to satisfy the remaining linter rules that weren't
auto-fixed by swift-format.
- Enable the format check in CI.
## Result
- Code that's not shared is formatted with a style consistent with the
other repos this team maintain.
- CI is now checking code format again.
---------
Co-authored-by: Cory Benfield <lukasa@apple.com>
Co-authored-by: Rick Newton-Rogers <rnro@apple.com>
* Add cxx interop build pipeline
* Update docker-compose.2204.59.yaml
* Change cxx interop CI step to build separate project instead of using cxx compiler flag
* Update docker-compose for 5.10
* Fix package name in docker
* Change code root dirname and remove test target
---------
Co-authored-by: Yim Lee <yim_lee@apple.com>
* Exclude AES from CMake
SwiftPM doesn't need it and this would allow removal of CCryptoBoringSSL dependency on non-Darwin platforms, thus reducing SwiftPM size.
* Update update_cmakelists.sh to exclude AES source files
In some cases developers have need of AES modes other than what we
support today, or need the ability to implement algorithms that require
access to the core AES permutation function. As a starting point, we can
provide access to the AES block function in CryptoExtras.
# Motivation
BoringSSL exposes AES-GCM-SIV algorithms which are in general useful to have and provide a nonce-misuse resistant mode of AES-GCM. Since, `CryptoKit` is not exposing AES-GCM-SIV we need to add this to `_CryptoExtras`
# Modification
Exposes `AES-GCM-SIV` through `_CryptoExtras`.
# Result
We can now use `AES-GCM-SIV` through `_CryptoExtras`.
Motivation:
When using only the CryptoKit API on Apple platforms we have always
thunked through to the CryptoKit interface and implementation. However,
we didn't do a thorough job of preventing the BoringSSL target from
getting compiled and linked.
We can do a better job now, which will save compile times and binary
sizes in many cases.
Modifications:
- Change Package.swift to express a target specific dependency in most
cases.
- Preserve a development mode which overrides that target specific
dependency.
- Add the missing compile guards.
Results:
Smaller binaries and faster compiles on Apple platforms.
motivation: source-kitten has changed how its invoked
changes:
* update docker file to install jazzy correctly
* invoke source-kitten with the correct flags
* make location of source-kitten source checkout more robust
Motivation:
The various Apple SoS projects are currently dropping Swift 5.1 support.
Swift Crypto should do the same. While we're here, let's add CI for 5.4,
5.5 nightlies, and main nightlies.
Modifications:
- Remove 5.1 dockerfile.
- Stop claiming we support 5.1.
- Add 5.4, 5.5, and main dockerfiles.
- Updated Swift Format to 5.2.
- Associated formatting changes.
Result:
Better test matrix and support matrix.
* Update vendor-boringssl to save modulemap
Motivation:
The vendor-boringssl script rewrites `include`, which leads to deletion of `module.modulemap`.
Modification:
Save a copy of modulemap to tmp dir and copy it back at the end.
Result:
`module.modulemap` remains after running the script.
* Recreate modulemap each time instead of copying
Add support for Windows for vending BoringSSL. This is required in
order to build SwiftCrypto for Windows.
Co-authored-by: Cory Benfield <lukasa@apple.com>
Motivation:
At WWDC 2020 Apple updated the CryptoKit APIs. This PR brings those new
APIs to Swift Crypto. This brings Swift Crypto up-to-date with the
latest CryptoKit API support, including PEM/DER key support and HKDF API
extensions.
Modifications:
- Bring forward the CryptoKit API files
- Update to have API match the WWDC seed.
Result:
Users will have access to the seed APIs.
motivation: docs scripts is broken on selinux due to restriction on ssh-agent
changes:
* change the jazzy workspace to a directory accessible by the CI node so we can push from the agent instead of from the docker container
* dont remove older docs when pushing new ones
* add version inforamtion and source links
Co-authored-by: Cory Benfield <lukasa@apple.com>
Motivation:
BoringSSL and Folly both attempt to play silly buggers with the sdallocx
symbol defined in jemalloc. Unfortunately, they don't play nicely
together, and the end result if you have both present is that BoringSSL
will reliably SIGBUS or SIGSEGV on initialization. Naturally, this isn't
good.
See also apple/swift-nio-ssl#191.
Modifications:
- Resolve the issue by patching out BoringSSL's allocator optimisation.
- Update BoringSSL to 6432bb46ab44731567ec923e6c8fc182f13d0070.
Result:
Flow and BoringSSL will play better together.
* Replaced ISSUE_TEMPLATE.md with directory containing four different issues types. Adding script for extraction of enviroment info, in order to make it easier for users to report issues.
* Updating year in sanity script
* 1) Adding gyb to scripts
2) Adding warning in gyb files about gyb overwritting manual edits to gyb generated swift files
3) Updated README with gyb instructions
4) Adding script for running all gyb generation
5) Adding CI check for discrepancies in gyb generated files
* Updating Dockerfile