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

Support for EdDSA certificates #328

Closed
wants to merge 11 commits into from
Closed

Support for EdDSA certificates #328

wants to merge 11 commits into from

Conversation

ocheron
Copy link
Contributor

@ocheron ocheron commented Dec 9, 2018

This adds and enables EdDSA support with TLS12 (described in RFC 8422) and TLS13.

EdDSA with TLS12 completes the refactoring started in #236 and adds a KeyExchangeSignatureAlg data type for reason already explained: ECDHE_ECDSA is used for both ECDSA and EdDSA.

EdDSA private-key operations need the public key, so the local public key is taken from the certificate chain and stored in the handshake state along with the private key. Otherwise deriving from the private key would add approx. 20% more time to the signature of a 10KB message.

I also align the TLS13 utilities used to generate and verify signatures to what exists with other versions, as well as other modifications explained in commit messages.

The algorithm can easily be recomputed from the private key.  Moreover
the local private key is not necessarily used for signature only.  It
can be used for RSA encryption too.
So that signature and verification functions are always used with the
same pattern.  This reduces differences between TLS12 and TLS13 code,
as well as client and server.
Function storePrivInfo is used from server code too, where the
CertificateType part is not needed.  This can be split into two
distinct functions.
This alert is to be used when validation of KX signatures, Finished
messages, or PSK binders fails.

This is consistent with RFC 5246 section 7.2.2:

   decrypt_error
      A handshake cryptographic operation failed, including being
      unable to correctly verify a signature or validate a Finished
      message.  This message is always fatal.

and RFC 8446 section 6.2:

   decrypt_error:  A handshake (not record layer) cryptographic
   operation failed, including being unable to correctly verify a
   signature or validate a Finished message or a PSK binder.
ECDSA is not implemented yet as we don't have secure implementation of
signature generation.  But this resolves #272.  It will also be useful
if ECDH private keys are added to the data type.
Handshake state now contains both local private and public keys.
This avoids deriving the public key for schemes like EdDSA.
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.

Excellent!

kazu-yamamoto added a commit to kazu-yamamoto/hs-tls that referenced this pull request Dec 10, 2018
@ocheron ocheron deleted the newcurves-rebased branch December 10, 2018 18:23
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.

2 participants