[nginx] SSL: fixed build with OPENSSL_NO_DEPRECATED defined.

Maxim Dounin mdounin at mdounin.ru
Wed Jul 9 01:49:45 UTC 2014


details:   http://hg.nginx.org/nginx/rev/8df08465fcfd
branches:  
changeset: 5755:8df08465fcfd
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Wed Jul 09 04:08:13 2014 +0400
description:
SSL: fixed build with OPENSSL_NO_DEPRECATED defined.

The RSA_generate_key() is marked as deprecated and causes build to
fail.  On the other hand, replacement function, RSA_generate_key_ex(),
requires much more code.  Since RSA_generate_key() is only needed
for barely usable EXP ciphers, the #ifdef was added instead.

Prodded by Piotr Sikora.

diffstat:

 src/event/ngx_event_openssl.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (18 lines):

diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -656,10 +656,14 @@ ngx_ssl_rsa512_key_callback(ngx_ssl_conn
         return NULL;
     }
 
+#ifndef OPENSSL_NO_DEPRECATED
+
     if (key == NULL) {
         key = RSA_generate_key(512, RSA_F4, NULL, NULL);
     }
 
+#endif
+
     return key;
 }
 



More information about the nginx-devel mailing list