diff options
author | Martin Willi <martin@revosec.ch> | 2010-09-03 11:45:55 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2010-09-03 14:54:43 +0200 |
commit | 37a59a8fbfc6f3203ecf79d9294fc10af981baf0 (patch) | |
tree | d191131092609f749d3e49ee5311ae261e46d55d /src/libtls/tls_crypto.c | |
parent | 141d7f7abd179fbc3f5c46e2f66fb75b01342886 (diff) | |
download | strongswan-37a59a8fbfc6f3203ecf79d9294fc10af981baf0.tar.bz2 strongswan-37a59a8fbfc6f3203ecf79d9294fc10af981baf0.tar.xz |
Support for EC curve Hello extension, EC curve fallback
Diffstat (limited to 'src/libtls/tls_crypto.c')
-rw-r--r-- | src/libtls/tls_crypto.c | 14 |
1 files changed, 14 insertions, 0 deletions
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, |