Skip to content

Remove test certificates from published package - #261

Open
weiznich wants to merge 1 commit into
rustls:mainfrom
GiGainfosystems:main
Open

weiznich wants to merge 1 commit into
rustls:mainfrom
GiGainfosystems:main

Conversation

@weiznich

Copy link
Copy Markdown

The published version of rustls-platform-verifier contains a larger number of test-certificates, e.g https://crates.io/crates/rustls-platform-verifier/0.7.1/code/src/tests/verification_real_world/aws_amazon_com_valid_1.crt

It would be good to exclude them from the published package to make reviewing the source code easier.

This PR adds an explicit include statement to the Cargo.toml file to only include files that are needed to build the crate, not to run all tests.

Specifically this PR removes the following files from the published package:

examples/update-certs.rs
src/tests/ffi.rs
src/tests/mod.rs
src/tests/verification_mock/ca.go
src/tests/verification_mock/go.mod
src/tests/verification_mock/go.sum
src/tests/verification_mock/mod.rs
src/tests/verification_mock/root1-int1-ee_1-good.crt
src/tests/verification_mock/root1-int1-ee_1-good.ocsp
src/tests/verification_mock/root1-int1-ee_1-revoked.crt
src/tests/verification_mock/root1-int1-ee_1-revoked.ocsp
src/tests/verification_mock/root1-int1-ee_1-wrong_eku.crt
src/tests/verification_mock/root1-int1-ee_127.0.0.1-good.crt
src/tests/verification_mock/root1-int1-ee_127.0.0.1-good.ocsp
src/tests/verification_mock/root1-int1-ee_127.0.0.1-revoked.crt
src/tests/verification_mock/root1-int1-ee_127.0.0.1-revoked.ocsp
src/tests/verification_mock/root1-int1-ee_127.0.0.1-wrong_eku.crt
src/tests/verification_mock/root1-int1-ee_example.com-good.crt
src/tests/verification_mock/root1-int1-ee_example.com-good.ocsp
src/tests/verification_mock/root1-int1-ee_example.com-revoked.crt
src/tests/verification_mock/root1-int1-ee_example.com-revoked.ocsp
src/tests/verification_mock/root1-int1-ee_example.com-wrong_eku.crt
src/tests/verification_mock/root1-int1.crt
src/tests/verification_mock/root1.crt
src/tests/verification_real_world/aws_amazon_com_valid_1.crt
src/tests/verification_real_world/aws_amazon_com_valid_2.crt
src/tests/verification_real_world/aws_amazon_com_valid_3.crt
src/tests/verification_real_world/aws_amazon_com_valid_4.crt
src/tests/verification_real_world/letsencrypt_org_valid_1.crt
src/tests/verification_real_world/letsencrypt_org_valid_2.crt
src/tests/verification_real_world/letsencrypt_org_valid_3.crt
src/tests/verification_real_world/letsencrypt_org_valid_4.crt
src/tests/verification_real_world/mod.rs
src/tests/verification_real_world/revoked_badssl_com_1.crt
src/tests/verification_real_world/revoked_badssl_com_1.ocsp
src/tests/verification_real_world/revoked_badssl_com_2.crt

The published version of `rustls-platform-verifier` contains a larger
number of test-certificates, e.g https://crates.io/crates/rustls-platform-verifier/0.7.1/code/src/tests/verification_real_world/aws_amazon_com_valid_1.crt

It would be good to exclude them from the published package to make
reviewing the source code easier.

This PR adds an explicit `include` statement to the `Cargo.toml` file to
only include files that are needed to build the crate, not to run all
tests.

Specifically this PR removes the following files from the published
package:

```
examples/update-certs.rs
src/tests/ffi.rs
src/tests/mod.rs
src/tests/verification_mock/ca.go
src/tests/verification_mock/go.mod
src/tests/verification_mock/go.sum
src/tests/verification_mock/mod.rs
src/tests/verification_mock/root1-int1-ee_1-good.crt
src/tests/verification_mock/root1-int1-ee_1-good.ocsp
src/tests/verification_mock/root1-int1-ee_1-revoked.crt
src/tests/verification_mock/root1-int1-ee_1-revoked.ocsp
src/tests/verification_mock/root1-int1-ee_1-wrong_eku.crt
src/tests/verification_mock/root1-int1-ee_127.0.0.1-good.crt
src/tests/verification_mock/root1-int1-ee_127.0.0.1-good.ocsp
src/tests/verification_mock/root1-int1-ee_127.0.0.1-revoked.crt
src/tests/verification_mock/root1-int1-ee_127.0.0.1-revoked.ocsp
src/tests/verification_mock/root1-int1-ee_127.0.0.1-wrong_eku.crt
src/tests/verification_mock/root1-int1-ee_example.com-good.crt
src/tests/verification_mock/root1-int1-ee_example.com-good.ocsp
src/tests/verification_mock/root1-int1-ee_example.com-revoked.crt
src/tests/verification_mock/root1-int1-ee_example.com-revoked.ocsp
src/tests/verification_mock/root1-int1-ee_example.com-wrong_eku.crt
src/tests/verification_mock/root1-int1.crt
src/tests/verification_mock/root1.crt
src/tests/verification_real_world/aws_amazon_com_valid_1.crt
src/tests/verification_real_world/aws_amazon_com_valid_2.crt
src/tests/verification_real_world/aws_amazon_com_valid_3.crt
src/tests/verification_real_world/aws_amazon_com_valid_4.crt
src/tests/verification_real_world/letsencrypt_org_valid_1.crt
src/tests/verification_real_world/letsencrypt_org_valid_2.crt
src/tests/verification_real_world/letsencrypt_org_valid_3.crt
src/tests/verification_real_world/letsencrypt_org_valid_4.crt
src/tests/verification_real_world/mod.rs
src/tests/verification_real_world/revoked_badssl_com_1.crt
src/tests/verification_real_world/revoked_badssl_com_1.ocsp
src/tests/verification_real_world/revoked_badssl_com_2.crt
```
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.

1 participant