Skip to content

[Collections] Signing (part 2): signed collections #3242

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

Closed
wants to merge 20 commits into from

Conversation

yim-lee
Copy link
Contributor

@yim-lee yim-lee commented Feb 7, 2021

This is part 2 of a series of PRs to support package collection signing.

Depends on part 1

Modifications:

  • Add support for signing with EC and RSA keys
  • Add Signature, which is similar to JWS
  • Introduce CertificatePolicy protocol (more on this in part 3)
  • PackageCollectionsSigning - given a package collection, certificate and its private key, generate a "signed" collection; and reverse that process to validate collection signature.

@yim-lee yim-lee force-pushed the signing-collection-2 branch 3 times, most recently from cf2b60d to fd58ae1 Compare February 7, 2021 19:47
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 8, 2021
This is part 3 of a series of PRs to support package collection signing.

Depends on [part 2](swiftlang#3242)

Modifications:
- Certificate policies to validate collection signing certificates. OCSP support on non-Apple platforms to come in part 4.
- Wire up `PackageCollectionSigning` with certificate policies.
@yim-lee yim-lee force-pushed the signing-collection-2 branch from f0124b1 to 8c32486 Compare February 8, 2021 07:56
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 8, 2021
This is part 3 of a series of PRs to support package collection signing.

Depends on [part 2](swiftlang#3242)

Modifications:
- Certificate policies to validate collection signing certificates. OCSP support on non-Apple platforms to come in part 4.
- Wire up `PackageCollectionSigning` with certificate policies.
@yim-lee yim-lee changed the title [WIP][Collections] Signing (part 2): signed collections [Collections] Signing (part 2): signed collections Feb 8, 2021
@yim-lee yim-lee force-pushed the signing-collection-2 branch from 8c32486 to 37369f8 Compare February 9, 2021 04:43
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 9, 2021
This is part 3 of a series of PRs to support package collection signing.

Depends on [part 2](swiftlang#3242)

Modifications:
- Certificate policies to validate collection signing certificates. OCSP support on non-Apple platforms to come in part 4.
- Wire up `PackageCollectionSigning` with certificate policies.
@yim-lee
Copy link
Contributor Author

yim-lee commented Feb 9, 2021

This is ready for review. The relevant commits are:

image

cc @Lukasa @FredericJacobs @catmurdoch PTAL. Thanks.

This is part 1 of a series of PRs to support package collection signing.

Modifications:
- New `PackageCollectionsSigning` module
- Add `Certificate` type
- Add EC and RSA key types
This is part 2 of a series of PRs to support package collection signing.

Depends on [part 1](swiftlang#3241)

Modifications:

Add support for signing with EC and RSA keys
- Introduce `CertificatePolicy` protocol (more on this in part 3)
- `PackageCollectionsSigning` - given a package collection, certificate and its private key, generate a "signed" collection; and reverse that process to validate collection signature.
@yim-lee yim-lee force-pushed the signing-collection-2 branch from 37369f8 to ecaec8a Compare February 10, 2021 02:08
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 12, 2021
This is part 2 of a series of PRs to support package collection signing on **Apple** platforms. Originally swiftlang#3242.

Depends on [part 1](swiftlang#3259)

Modifications:

- Add support for signing with EC and RSA keys
- Add `Signature`, which is similar to JWS
- Introduce `CertificatePolicy` protocol (more on this in part 3)
- `PackageCollectionsSigning` - given a package collection, certificate and its private key, generate a "signed" collection; and reverse that process to validate collection signature.
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 12, 2021
This is part 2 of a series of PRs to support package collection signing on **non-Apple** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
@yim-lee
Copy link
Contributor Author

yim-lee commented Feb 12, 2021

Closing this PR, which has been split into #3264 and #3265

@yim-lee yim-lee closed this Feb 12, 2021
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 13, 2021
This is part 2 of a series of PRs to support package collection signing on **Apple** platforms. Originally swiftlang#3242.

Depends on [part 1](swiftlang#3259)

Modifications:

- Add support for signing with EC and RSA keys
- Add `Signature`, which is similar to JWS
- Introduce `CertificatePolicy` protocol (more on this in part 3)
- `PackageCollectionsSigning` - given a package collection, certificate and its private key, generate a "signed" collection; and reverse that process to validate collection signature.
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 13, 2021
This is part 2 of a series of PRs to support package collection signing on **Apple** platforms. Originally swiftlang#3242.

Depends on [part 1](swiftlang#3259)

Modifications:

- Add support for signing with EC and RSA keys
- Add `Signature`, which is similar to JWS
- Introduce `CertificatePolicy` protocol (more on this in part 3)
- `PackageCollectionsSigning` - given a package collection, certificate and its private key, generate a "signed" collection; and reverse that process to validate collection signature.
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 13, 2021
This is part 2 of a series of PRs to support package collection signing on **non-Apple** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 17, 2021
This is part 2 of a series of PRs to support package collection signing on **Apple** platforms. Originally swiftlang#3242.

Depends on [part 1](swiftlang#3259)

Modifications:

- Add support for signing with EC and RSA keys
- Add `Signature`, which is similar to JWS
- Introduce `CertificatePolicy` protocol (more on this in part 3)
- `PackageCollectionsSigning` - given a package collection, certificate and its private key, generate a "signed" collection; and reverse that process to validate collection signature.
yim-lee added a commit that referenced this pull request Feb 18, 2021
This is part 2 of a series of PRs to support package collection signing on **Apple** platforms. Originally #3242.

Depends on [part 1](#3259)

Modifications:

- Add support for signing with EC and RSA keys
- Add `Signature`, which is similar to JWS
- Introduce `CertificatePolicy` protocol (more on this in part 3)
- `PackageCollectionsSigning` - given a package collection, certificate and its private key, generate a "signed" collection; and reverse that process to validate collection signature.
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 18, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 18, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 18, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 18, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 20, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 22, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 26, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Feb 26, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Mar 2, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Mar 9, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Mar 10, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Mar 11, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Mar 11, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Mar 12, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Mar 12, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Mar 13, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Mar 20, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Mar 22, 2021
This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally swiftlang#3242.

Depends on swiftlang#3260, swiftlang#3264
yim-lee added a commit that referenced this pull request Mar 24, 2021
* [Collections] Signing (all, 1): certificate and key types

This is part 1 of a series of PRs to support package collection signing on **all** platforms. Originally #3238.

Depends on #3259

* [Collections] Signing (all, 2): signed collections

This is part 2 of a series of PRs to support package collection signing on **all** platforms. Originally #3242.

Depends on #3260, #3264

* [Collections] Signing (all, 3): certificate validations

This is part 3 of a series of PRs to support package collection signing on **all** platforms. Originally #3245.

Depends on #3265, #3269

* [Collections] Signing (all, 3.b): OCSP support for non-Apple platforms

This is part 3.b of a series of PRs to support package collection signing on **all** platforms.

Depends on #3270

Modifications:
- Add `PackageCollectionsSigningLibc` module
- Add OCSP support for non-Apple platforms through `PackageCollectionsSigningLibc`

* Use shared callbackQueue and diagnosticsEngine in tests

* Update platform check

* Better OCSP error handling and cache OCSP results

* Don't default to BoringSSL

* OpenSSL license

* fixup

* Use ptr.count

* Don't blindly drop X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION error

* Add withUnsafeMutablePointer for accessing underlying X509 pointer

* Fix leaks

* Use withExtendedLifetime

* OSCP response handling

* Delete remove from cache call

* OCSP should fail open

* Verify OCSP response

* Create new X509_STORE per invocation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants