From 37a59a8fbfc6f3203ecf79d9294fc10af981baf0 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Fri, 3 Sep 2010 11:45:55 +0200 Subject: Support for EC curve Hello extension, EC curve fallback --- src/libtls/tls_crypto.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/libtls/tls_crypto.c') diff --git a/src/libtls/tls_crypto.c b/src/libtls/tls_crypto.c index e38bf83cf..d2d8885ca 100644 --- a/src/libtls/tls_crypto.c +++ b/src/libtls/tls_crypto.c @@ -757,6 +757,19 @@ METHOD(tls_crypto_t, get_signature_algorithms, void, supported->destroy(supported); } +METHOD(tls_crypto_t, get_curves, void, + private_tls_crypto_t *this, tls_writer_t *writer) +{ + u_int16_t curves[] = { + htons(TLS_SECP256R1), + htons(TLS_SECP384R1), + htons(TLS_SECP521R1), + htons(TLS_SECP192R1), + htons(TLS_SECP224R1), + }; + writer->write_data16(writer, chunk_from_thing(curves)); +} + METHOD(tls_crypto_t, set_protection, void, private_tls_crypto_t *this, tls_protection_t *protection) { @@ -1215,6 +1228,7 @@ tls_crypto_t *tls_crypto_create(tls_t *tls) .select_cipher_suite = _select_cipher_suite, .get_dh_group = _get_dh_group, .get_signature_algorithms = _get_signature_algorithms, + .get_curves = _get_curves, .set_protection = _set_protection, .append_handshake = _append_handshake, .sign = _sign, -- cgit v1.2.3