-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Rewrite PackageCollectionsSigning using swift-certificates #6468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
case appleSwiftPackageCollection(subjectUserID: String? = nil, subjectOrganizationalUnit: String? = nil) | ||
|
||
@available(*, deprecated, message: "use `appleSwiftPackageCollection` instead") | ||
case appleDistribution(subjectUserID: String? = nil, subjectOrganizationalUnit: String? = nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deprecated
} | ||
|
||
Task { | ||
var trustStore = CertificateStores.defaultTrustRoots |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A major change in the new implementation is that we no longer use the system trust store (we used to on Darwin platforms through the Security
framework) and SwiftPM will its own default trust store instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both this and PackageSigning
require the same resources. Would it make sense to have a shared resource-only module?
f3b0bdc
to
6a2c60d
Compare
@swift-ci please test Windows platform |
/** Package collections signing C lib */ | ||
name: "PackageCollectionsSigningLibc", | ||
dependencies: [ | ||
.product(name: "Crypto", package: "swift-crypto"), // for CCryptoBoringSSL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done still need the dependency on swift-crypto?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we still need it for keys and signing.
7362c2a
to
9702079
Compare
9702079
to
b029026
Compare
Figured it out. Moving this out of Draft. |
Motivation: `PackageCollectionsSigning` was written before `swift-certificates` and `swift-asn1` were available. The implementation relied on BoringSSL C library via `CCryptoBoringSSL`, which is not meant to be used outside of `swift-crypto` because it introduces Swift-breaking changes often (as SwiftPM had experienced with version `2.4.1`). Modifications: - Rewrite `PackageCollectionsSigning` using `swift-certificates` and `swift-asn1` so we can remove `CCryptoBoringSSL` dependency. - `PackageCollectionsSigningLibC`, which contains SwiftPM's implementation of OCSP, is no longer needed and removed in this PR.
b029026
to
63ca5f0
Compare
@swift-ci please smoke test |
@swift-ci please test Windows platform |
Motivation:
PackageCollectionsSigning
was written beforeswift-certificates
andswift-asn1
were available. The implementation relied on BoringSSL C library viaCCryptoBoringSSL
, which is not meant to be used outside ofswift-crypto
because it introduces Swift-breaking changes often (as SwiftPM had experienced with version2.4.1
).Modifications:
PackageCollectionsSigning
usingswift-certificates
andswift-asn1
so we can removeCCryptoBoringSSL
dependency.PackageCollectionsSigningLibC
, which contains SwiftPM's implementation of OCSP, is no longer needed and removed in this PR.