Add three Suite B modes to TLS code, supporting RFC6460.
[openssl.git] / ssl / s3_srvr.c
index 2f23f2121bd98ff8878d9d6c8738602ba58837c0..76f49f7978b9e0e0cfb56f6cba3a6dcb1ea34ef7 100644 (file)
@@ -1704,8 +1704,8 @@ int ssl3_send_server_key_exchange(SSL *s)
                        ecdhp=cert->ecdh_tmp;
                        if (s->cert->ecdh_tmp_auto)
                                {
-                               /* Get NID of first shared curve */
-                               int nid = tls1_shared_curve(s, 0);
+                               /* Get NID of appropriate shared curve */
+                               int nid = tls1_shared_curve(s, -2);
                                if (nid != NID_undef)
                                        ecdhp = EC_KEY_new_by_curve_name(nid);
                                }