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

Additional verification regarding EC signatures #412

Merged
merged 6 commits into from
Jan 7, 2020
Merged

Additional verification regarding EC signatures #412

merged 6 commits into from
Jan 7, 2020

Conversation

ocheron
Copy link
Contributor

@ocheron ocheron commented Jan 6, 2020

  • Prevents to use EdDSA with TLS10 and TLS11. EdDSA support is signaled through "signature_algorithms" only, so needs TLS12 or later for proper negotiation between client and server.
  • For TLS13, verifies that the received elliptic curve matches the hash algorithm chosen by peer (i.e. SHA-256 is for P-256, SHA-384 is for P-384, etc.)
  • For TLS12 or before, verifies that the elliptic curve used to generate an ECDSA signature matches sent extension "Supported Elliptic Curves"
  • For uniform behavior, make sure we call isDigitalSignaturePair before TLS12 too

EdDSA support is only signaled through "signature_algorithms" so needs
TLS12 for proper negotiation between client and server.
Starting with TLS13, the hash in the "signature_algorithm" value must
be compatible with the elliptic curve used to generate the signature.
This commit adds the verification.
For TLS 1.2 and below, a client verifying an ECDSA signature now
checks that the elliptic curve used to generate the signature is part
of the supported curves it previously announced in the extension.

As consequence, elliptic curves that are not P-256, P-384, P-521 are
not accepted anymore.
@kazu-yamamoto kazu-yamamoto mentioned this pull request Jan 6, 2020
5 tasks
@kazu-yamamoto kazu-yamamoto self-requested a review January 7, 2020 01:57
Copy link
Collaborator

@kazu-yamamoto kazu-yamamoto left a comment

Choose a reason for hiding this comment

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

LGTM

kazu-yamamoto added a commit to kazu-yamamoto/hs-tls that referenced this pull request Jan 7, 2020
@kazu-yamamoto kazu-yamamoto merged commit 9838161 into haskell-tls:master Jan 7, 2020
@kazu-yamamoto
Copy link
Collaborator

Merged!

@ocheron ocheron deleted the ec-restrictions branch January 20, 2020 05:48
@kazu-yamamoto kazu-yamamoto mentioned this pull request Feb 19, 2020
2 tasks
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.

None yet

2 participants