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

Add an explicit curve test #173

Merged
merged 5 commits into from
Mar 13, 2024
Merged

Add an explicit curve test #173

merged 5 commits into from
Mar 13, 2024

Conversation

woodruffw
Copy link
Collaborator

@woodruffw woodruffw commented Jan 17, 2024

WIP. The idea here is to build a testcase where the chain contains a certificate with an explicit EC point encoding, rather than a namedCurve encoding. This should be rejected by CABF-conforming validators.

Blockers:

  • Cryptography (rightfully) doesn't support loading these keys
  • I refuse to write this testcase by hand with openssl req I gave up and did it.

@woodruffw woodruffw added the component:tests 🧪 Unit and integration tests label Jan 17, 2024
@woodruffw woodruffw self-assigned this Jan 17, 2024
@woodruffw
Copy link
Collaborator Author

crypto/x509 also reasonably doesn't allow this, which suggests that I'm asking for two incompatible things (an implementation that's good enough for me to build this testcase with, but bad enough that it'll accept an explicit curve encoding). So I'm shelving this for now.

@woodruffw woodruffw mentioned this pull request Jan 17, 2024
16 tasks
Copy link
Contributor

:shipit: No regressions found.

Copy link
Contributor

github-actions bot commented Mar 12, 2024

New testcases

There are new testcases in this change.

gocryptox509-go1.22.0

Testcase Expected Result Actual Result Context
webpki::explicit-curve FAILURE FAILURE

certvalidator-0.11.1

Testcase Expected Result Actual Result Context
webpki::explicit-curve FAILURE SUCCESS None

openssl-3.0.13

Testcase Expected Result Actual Result Context
webpki::explicit-curve FAILURE FAILURE Certificate public key has explicit ECC parameters

openssl-3.2.1

Testcase Expected Result Actual Result Context
webpki::explicit-curve FAILURE FAILURE Certificate public key has explicit ECC parameters

pyca-cryptography-42.0.5

Testcase Expected Result Actual Result Context
webpki::explicit-curve FAILURE FAILURE validation failed: CandidatesExhausted(Other("Forbidden public key algorithm: AlgorithmIdentifier { oid: DefinedByMarker(PhantomDataasn1::object_identifier::ObjectIdentifier), params: Ec(SpecifiedCurve(Sequence { data: [2, 1, 1, 48, 44, 6, 7, 42, 134, 72, 206, 61, 1, 1, 2, 33, 0, 255, 255, 255, 255, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 48, 91, 4, 32, 255, 255, 255, 255, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 252, 4, 32, 90, 198, 53, 216, 170, 58, 147, 231, 179, 235, 189, 85, 118, 152, 134, 188, 101, 29, 6, 176, 204, 83, 176, 246, 59, 206, 60, 62, 39, 210, 96, 75, 3, 21, 0, 196, 157, 54, 8, 134, 231, 4, 147, 106, 102, 120, 225, 19, 157, 38, 183, 129, 159, 126, 144, 4, 65, 4, 107, 23, 209, 242, 225, 44, 66, 71, 248, 188, 230, 229, 99, 164, 64, 242, 119, 3, 125, 129, 45, 235, 51, 160, 244, 161, 57, 69, 216, 152, 194, 150, 79, 227, 66, 226, 254, 26, 127, 155, 142, 231, 235, 74, 124, 15, 158, 22, 43, 206, 51, 87, 107, 49, 94, 206, 203, 182, 64, 104, 55, 191, 81, 245, 2, 33, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 188, 230, 250, 173, 167, 23, 158, 132, 243, 185, 202, 194, 252, 99, 37, 81, 2, 1, 1] })) }"))

rustls-webpki

Testcase Expected Result Actual Result Context
webpki::explicit-curve FAILURE FAILURE UnsupportedSignatureAlgorithmForPublicKey

rust-webpki

Testcase Expected Result Actual Result Context
webpki::explicit-curve FAILURE FAILURE UnknownIssuer

openssl-3.1.5

Testcase Expected Result Actual Result Context
webpki::explicit-curve FAILURE FAILURE Certificate public key has explicit ECC parameters

openssl-1.1

Testcase Expected Result Actual Result Context
webpki::explicit-curve FAILURE FAILURE Certificate public key has explicit ECC parameters

Signed-off-by: William Woodruff <[email protected]>
@woodruffw woodruffw changed the title _assets: begin hacking up an explicit curve test Add an explicit curve test Mar 12, 2024
@woodruffw woodruffw marked this pull request as ready for review March 12, 2024 19:54
@woodruffw
Copy link
Collaborator Author

validation failed: CandidatesExhausted(Other("Forbidden public key algorithm: AlgorithmIdentifier { oid: DefinedByMarker(PhantomDataasn1::object_identifier::ObjectIdentifier), params: Ec(SpecifiedCurve(Sequence { data: [2, 1, 1, 48, 44, 6, 7, 42, 134, 72, 206, 61, 1, 1, 2, 33, 0, 255, 255, 255, 255, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 48, 91, 4, 32, 255, 255, 255, 255, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 252, 4, 32, 90, 198, 53, 216, 170, 58, 147, 231, 179, 235, 189, 85, 118, 152, 134, 188, 101, 29, 6, 176, 204, 83, 176, 246, 59, 206, 60, 62, 39, 210, 96, 75, 3, 21, 0, 196, 157, 54, 8, 134, 231, 4, 147, 106, 102, 120, 225, 19, 157, 38, 183, 129, 159, 126, 144, 4, 65, 4, 107, 23, 209, 242, 225, 44, 66, 71, 248, 188, 230, 229, 99, 164, 64, 242, 119, 3, 125, 129, 45, 235, 51, 160, 244, 161, 57, 69, 216, 152, 194, 150, 79, 227, 66, 226, 254, 26, 127, 155, 142, 231, 235, 74, 124, 15, 158, 22, 43, 206, 51, 87, 107, 49, 94, 206, 203, 182, 64, 104, 55, 191, 81, 245, 2, 33, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 188, 230, 250, 173, 167, 23, 158, 132, 243, 185, 202, 194, 252, 99, 37, 81, 2, 1, 1] })) }"))

Maybe I should shorten that error message...

@woodruffw woodruffw merged commit a04fb05 into main Mar 13, 2024
7 checks passed
@woodruffw woodruffw deleted the ww/explicitcurve branch March 13, 2024 14:55
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.

1 participant