Skip to content
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

test: add additional test certs #4353

Merged
merged 10 commits into from
Jan 24, 2024
Merged

test: add additional test certs #4353

merged 10 commits into from
Jan 24, 2024

Conversation

jmayclin
Copy link
Contributor

Description of changes:

  1. expand the generate-certs.sh script to also generate certs with different digests
  2. move the generate-certs.sh script to the test/pems folder
  3. check in committed certs
  4. create symlinks for the bench harness to use
  5. add helper function to retrieve the test certs in testlib.h

Call-outs:

We could this certs to remove some of the free-floating, non reproducible certs that we currently rely on. However the PR seems large enough as is, so I think it's better to wait for the future on that.

Testing:

This is currently being used for test certs in my cert-key-restriction branch.
Existing tests should continue to pass, including the benchmark harness tests which rely on these.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Jan 10, 2024
@jmayclin jmayclin marked this pull request as ready for review January 19, 2024 03:00
@jmayclin jmayclin enabled auto-merge (squash) January 19, 2024 03:01
- remove unused artifacts (server cert, intermediate cert and key)
- also add more pss examples and a better readme
tests/testlib/s2n_test_certs.c Outdated Show resolved Hide resolved
@@ -121,25 +138,45 @@ cert-gen () {
echo "verifying client certificates"
openssl verify -CAfile ca-cert.pem client-cert.pem

echo "cleaning up temporary files"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I just noticed is that the ca-cert gets added to the server-chain.pem (line 132). It probably shouldn't be in there, root certs aren't actually sent over the wire since the verifier should already have it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least for AWS services, it seems to be common practice to include the root CA in the chain sent by the server. E.g. S3 returns the leaf, intermediate, root CA, and old CA that cross-signed the Amazon Root

- forgot to remove printf statement :'(
Copy link
Contributor

@dougch dougch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

cert-gen rsa 2048 rsa2048
cert-gen rsa 3072 rsa3072
cert-gen rsa 4096 rsa4096
# key signature key_size digest directory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so readable.

@jmayclin jmayclin merged commit f355e93 into aws:main Jan 24, 2024
30 checks passed
@jmayclin jmayclin deleted the cert-perms branch July 1, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants