Improve backwards compat with 1.0.2 for ECDHParameters
authorMatt Caswell <matt@openssl.org>
Fri, 20 Apr 2018 13:12:11 +0000 (14:12 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 24 Apr 2018 08:09:43 +0000 (09:09 +0100)
In 1.0.2 you could configure automatic ecdh params by using the
ECDHParameters config directive and setting it to the value
"+Automatic" or just "Automatic". This is no longer required in 1.1.0+
but we still recognise the "+Automatic" keyword for backwards compatibility.
However we did not recognise just "Automatic" without the leading "+" which
is equally valid. This commit fixes that omission.

Fixes #4113

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6035)

doc/man3/SSL_CONF_cmd.pod
ssl/ssl_conf.c

index e3dc42c3b38b63a570d5769b993e0fc0980cb795..4d3e9c2b72845121e9eb1c256f829a60c78352c7 100644 (file)
@@ -597,10 +597,6 @@ Set supported curves to P-256, P-384:
 
  SSL_CONF_cmd(ctx, "Curves", "P-256:P-384");
 
-Set automatic support for any elliptic curve for key exchange:
-
- SSL_CONF_cmd(ctx, "ECDHParameters", "Automatic");
-
 =head1 RETURN VALUES
 
 SSL_CONF_cmd() returns 1 if the value of B<cmd> is recognised and B<value> is
index 30e43d9b82330c7473f6e303f324a3ed3178cc67..f1e8200b70e8c4ef1bccc7e2903941364e8733dd 100644 (file)
@@ -229,8 +229,9 @@ static int cmd_ECDHParameters(SSL_CONF_CTX *cctx, const char *value)
     int nid;
 
     /* Ignore values supported by 1.0.2 for the automatic selection */
-    if ((cctx->flags & SSL_CONF_FLAG_FILE) &&
-        strcasecmp(value, "+automatic") == 0)
+    if ((cctx->flags & SSL_CONF_FLAG_FILE)
+            && (strcasecmp(value, "+automatic") == 0
+                || strcasecmp(value, "automatic") == 0))
         return 1;
     if ((cctx->flags & SSL_CONF_FLAG_CMDLINE) &&
         strcmp(value, "auto") == 0)