Skip to content

Update tests to allow chains in any order. Fixes #68. #69

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

Merged
merged 1 commit into from
Aug 12, 2020

Conversation

lgarron
Copy link
Contributor

@lgarron lgarron commented Jul 30, 2020

The chain in question is defined in RFC5652 as a CertificateSet, which is a SET OF certs:

Go 1.15 introduced a change that sorts such sets: https://go.googlesource.com/go/+/f0cea848679b8f8cdc5f76e1b1e36ebb924a68f8

Our tests were implicitly relying on the sets to stay in the order we order we create them (leaf then intermediate then root, or a truncated subset of those), but the right thing to do at this point is update our tests.

@@ -37,8 +46,8 @@ func TestSignIncludeCertsAIA(t *testing.T) {
require.NoError(t, err)

require.Equal(t, 2, len(certs))
Copy link
Contributor Author

@lgarron lgarron Jul 30, 2020

Choose a reason for hiding this comment

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

Note that we already check the chain size, so we'll still be testing that the chains are "equal" to what is expected.

Copy link
Contributor

@cryptoque cryptoque left a comment

Choose a reason for hiding this comment

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

Makes sense to me 👍

The chain in question is defined in RFC5652 as a CertificateSet, which is a `SET OF` certs:

- https://tools.ietf.org/html/rfc5652#section-5.1
- https://tools.ietf.org/html/rfc5652#section-10.2.3

Go 1.15 introduced a change that sorts such sets: https://go.googlesource.com/go/+/f0cea848679b8f8cdc5f76e1b1e36ebb924a68f8

Our tests were implicitly relying on the sets to stay sorted, but the right thing to do at this point is update our tests.
@lgarron lgarron force-pushed the cert-set-test-fix branch from a9d7043 to d7c50b9 Compare July 31, 2020 01:01
@lgarron lgarron merged commit d7c50b9 into master Aug 12, 2020
@lgarron lgarron deleted the cert-set-test-fix branch August 12, 2020 00:57
@ptoomey3
Copy link
Member

🎊

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.

4 participants