Use mirage-crypto-ec for elliptic curves, support ECDSA certificates#428
Conversation
…fiat This unifies the crypto primitives being used, and adds support for P384 and P521 ECDH.
3d0aded to
a08242f
Compare
cc11724 to
ef29c43
Compare
|
This is ready. I tested with the interop-sclient and interop-sserver shell scripts (using openssl on the other end). The first commit is pretty straightforward, it uses the DH from mirage-crypto-ec for elliptic curves.
This PR builds a working configuration at "Tls.Config.client/server" invocation (depending on provided values and certificates, it may restrict some parameters (ciphers/groups/signature_algorithms), may lead to an error (conflicting values provided), and during session initiation it attempts to select a working set of parameters (group, certificate, ciphersuite, signature_algorithm) -- taking the 1.0/1.1 vs 1.2 vs 1.3 differences into account. TL;DR: The API changed slightly (some types are gone now), a server configuration may have multiple certificates for the same hostnames (but different public key types), and the interoperability with openssl has been tested. |
ef29c43 to
3f1f866
Compare
CHANGES: * Remove static RSA and CBC ciphersuites from default configuration. The default configuration now includes FFDHE and ECDHE key exchanges with RSA or ECDSA/EdDSA certificates, and AEAD ciphers (AES-GCM, AES-CCM, ChaCha20-Poly1305) (mirleft/ocaml-tls#429 by @hannesm) * Remove SHA1 from signature_algorithms in the default configuration (mirleft/ocaml-tls#429 by @hannesm) * Support ECDSA and EdDSA certificates and private keys via x509 0.12.0 and mirage-crypto-ec (mirleft/ocaml-tls#428 by @hannesm) Breaking changes: - the second part of type Tls.Config.certchain is now a X509.Private_key.t (previously Mirage_crypto_pk.Rsa.priv) - the type aliases X509_lwt.priv and X509_lwt.authenticator have been removed * Use mirage-crypto-ec instead of fiat-p256 and hacl_x25519 for elliptic curve support - this adds P384 and P521 ECDH support (mirleft/ocaml-tls#428 by @hannesm) * Remove custom Monad implementation, use Result and Rresult instead (mirleft/ocaml-tls#429 by @hannesm) * Remove Utils.Cs submodule, use Cstruct API instead (mirleft/ocaml-tls#429 by @hannesm) * Breaking: Tls.Engine.ret type is now a result instead of a custom variant type (mirleft/ocaml-tls#429 by @hannesm) * Breaking: Tls_lwt.Unix.epoch results in (Tls.Core.epoch_data, unit) result - it was a custom error type previously (mirleft/ocaml-tls#429 by @hannesm)
This unifies the elliptic crypto primitives being used (X25519/P256), and adds support for P384 and P521 ECDH.
In addition, ECDSA (and EdDSA) certificates are now supported.