Skip to content

crypto/tls: add ECH provider rejection unit tests#192

Open
Abhicodeitout wants to merge 1 commit intocloudflare:cffrom
Abhicodeitout:unit-test
Open

crypto/tls: add ECH provider rejection unit tests#192
Abhicodeitout wants to merge 1 commit intocloudflare:cffrom
Abhicodeitout:unit-test

Conversation

@Abhicodeitout
Copy link
Copy Markdown

Summary

Add unit tests for ECH provider rejection behavior when the client-facing server receives malformed GREASE-like or unsupported algorithm combinations.

What changed

  • Added a test case that uses a known config_id with an encapsulated key generated under a different KEM.
    • Expected behavior: provider returns reject (not abort).
  • Added a test case that uses a known config_id with an unsupported KDF/AEAD pair.
    • Expected behavior: provider returns reject.
  • Kept all changes in src/crypto/tls/ech_test.go.

Why

A reviewer suggestion on #95 asked for explicit coverage that the client-facing server rejects:

  • GREASE ECH that matches config_id but uses a different KEM.
  • Unsupported KDF/AEAD algorithm combinations.

These tests lock in the intended reject path for both cases.

Verification

Executed with repository toolchain:

GOROOT=/workspaces/go ../bin/go test crypto/tls -run TestECHProvider -count=1 -v

Result: PASS, including both new subtests.

Commit

Includes Signed-off-by: Abhishek Kumar Kushwaha abhithegabbar@gmail.com.

Signed-off-by: Abhishek Kumar Kushwaha <abhithegabbar@gmail.com>
@Abhicodeitout
Copy link
Copy Markdown
Author

@benburkert @evanphx @bmizerany can you review

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