context: Support ECDH cipher suites, where applicable

Sun, 03 Jul 2011 13:13:36 -0700

author
Paul Aurich <paul@darkrain42.org>
date
Sun, 03 Jul 2011 13:13:36 -0700
changeset 42
b6271d3bae0b
parent 41
e26f1f91118a
child 43
708d39695790

context: Support ECDH cipher suites, where applicable

src/context.c file | annotate | diff | comparison | revisions
--- a/src/context.c	Sun Jul 03 13:13:36 2011 -0700
+++ b/src/context.c	Sun Jul 03 13:13:36 2011 -0700
@@ -269,6 +269,14 @@
    * for server mode, but clearer to put it here rather than set_mode.
    */
   SSL_CTX_set_tmp_dh_callback(ctx->context, dh_param_cb);
+#if defined(SSL_CTX_set_tmp_ecdh)
+  /*
+   * Support ECDH parameters.  This uses the 384 bit prime field from
+   * NIST.
+   */
+  SSL_CTX_set_tmp_ecdh(ctx->context, EC_KEY_new_by_curve_name(NID_secp384r1));
+#endif
+
   SSL_CTX_set_ex_data(ctx->context, luasec_sslctx_idx, ctx);
 
   luaL_getmetatable(L, "SSL:Context");

mercurial