[nginx] SSL: stop loading configs with invalid "ssl_ciphers" val...

Maxim Dounin mdounin at mdounin.ru
Mon Sep 23 15:23:51 UTC 2013


details:   http://hg.nginx.org/nginx/rev/0fbcfab0bfd7
branches:  
changeset: 5387:0fbcfab0bfd7
user:      Piotr Sikora <piotr at cloudflare.com>
date:      Sun Sep 22 22:36:11 2013 -0700
description:
SSL: stop loading configs with invalid "ssl_ciphers" values.

While there, remove unnecessary check in ngx_mail_ssl_module.

Signed-off-by: Piotr Sikora <piotr at cloudflare.com>

diffstat:

 src/http/modules/ngx_http_ssl_module.c |   1 +
 src/mail/ngx_mail_ssl_module.c         |  17 ++++++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diffs (38 lines):

diff --git a/src/http/modules/ngx_http_ssl_module.c b/src/http/modules/ngx_http_ssl_module.c
--- a/src/http/modules/ngx_http_ssl_module.c
+++ b/src/http/modules/ngx_http_ssl_module.c
@@ -561,6 +561,7 @@ ngx_http_ssl_merge_srv_conf(ngx_conf_t *
         ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
                       "SSL_CTX_set_cipher_list(\"%V\") failed",
                       &conf->ciphers);
+        return NGX_CONF_ERROR;
     }
 
     if (conf->verify) {
diff --git a/src/mail/ngx_mail_ssl_module.c b/src/mail/ngx_mail_ssl_module.c
--- a/src/mail/ngx_mail_ssl_module.c
+++ b/src/mail/ngx_mail_ssl_module.c
@@ -287,15 +287,14 @@ ngx_mail_ssl_merge_conf(ngx_conf_t *cf, 
         return NGX_CONF_ERROR;
     }
 
-    if (conf->ciphers.len) {
-        if (SSL_CTX_set_cipher_list(conf->ssl.ctx,
-                                   (const char *) conf->ciphers.data)
-            == 0)
-        {
-            ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
-                          "SSL_CTX_set_cipher_list(\"%V\") failed",
-                          &conf->ciphers);
-        }
+    if (SSL_CTX_set_cipher_list(conf->ssl.ctx,
+                                (const char *) conf->ciphers.data)
+        == 0)
+    {
+        ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
+                      "SSL_CTX_set_cipher_list(\"%V\") failed",
+                      &conf->ciphers);
+        return NGX_CONF_ERROR;
     }
 
     if (conf->prefer_server_ciphers) {



More information about the nginx-devel mailing list