Add support for automatic ECDH temporary key parameter selection. When
enabled instead of requiring an application to hard code a (possibly inappropriate) parameter set and delve into EC internals we just automatically use the preferred curve. (backport from HEAD)
This commit is contained in:
@@ -1693,10 +1693,11 @@ bad:
|
||||
{
|
||||
EC_KEY *ecdh=NULL;
|
||||
|
||||
if (named_curve)
|
||||
if (named_curve && strcmp(named_curve, "auto"))
|
||||
{
|
||||
int nid = OBJ_sn2nid(named_curve);
|
||||
|
||||
int nid = EC_curve_nist2nid(named_curve);
|
||||
if (nid == NID_undef)
|
||||
nid = OBJ_sn2nid(named_curve);
|
||||
if (nid == 0)
|
||||
{
|
||||
BIO_printf(bio_err, "unknown curve name (%s)\n",
|
||||
@@ -1716,6 +1717,8 @@ bad:
|
||||
{
|
||||
BIO_printf(bio_s_out,"Setting temp ECDH parameters\n");
|
||||
}
|
||||
else if (named_curve)
|
||||
SSL_CTX_set_ecdh_auto(ctx, 1);
|
||||
else
|
||||
{
|
||||
BIO_printf(bio_s_out,"Using default temp ECDH parameters\n");
|
||||
|
||||
Reference in New Issue
Block a user