comparison src/event/ngx_event_openssl.c @ 7960:ec2798eb3648 stable-1.20

SSL: RSA data type is deprecated in OpenSSL 3.0. The only consumer is a callback function for SSL_CTX_set_tmp_rsa_callback() deprecated in OpenSSL 1.1.0. Now the function is conditionally compiled too.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 10 Aug 2021 23:42:59 +0300
parents efbcecbe5805
children 1e0fabbe01c7
comparison
equal deleted inserted replaced
7959:efbcecbe5805 7960:ec2798eb3648
1114 } 1114 }
1115 } 1115 }
1116 } 1116 }
1117 1117
1118 1118
1119 #if (OPENSSL_VERSION_NUMBER < 0x10100001L && !defined LIBRESSL_VERSION_NUMBER)
1120
1119 RSA * 1121 RSA *
1120 ngx_ssl_rsa512_key_callback(ngx_ssl_conn_t *ssl_conn, int is_export, 1122 ngx_ssl_rsa512_key_callback(ngx_ssl_conn_t *ssl_conn, int is_export,
1121 int key_length) 1123 int key_length)
1122 { 1124 {
1123 static RSA *key; 1125 static RSA *key;
1124 1126
1125 if (key_length != 512) { 1127 if (key_length != 512) {
1126 return NULL; 1128 return NULL;
1127 } 1129 }
1128 1130
1129 #if (OPENSSL_VERSION_NUMBER < 0x10100003L && !defined OPENSSL_NO_DEPRECATED) 1131 #ifndef OPENSSL_NO_DEPRECATED
1130 1132
1131 if (key == NULL) { 1133 if (key == NULL) {
1132 key = RSA_generate_key(512, RSA_F4, NULL, NULL); 1134 key = RSA_generate_key(512, RSA_F4, NULL, NULL);
1133 } 1135 }
1134 1136
1135 #endif 1137 #endif
1136 1138
1137 return key; 1139 return key;
1138 } 1140 }
1141
1142 #endif
1139 1143
1140 1144
1141 ngx_array_t * 1145 ngx_array_t *
1142 ngx_ssl_read_password_file(ngx_conf_t *cf, ngx_str_t *file) 1146 ngx_ssl_read_password_file(ngx_conf_t *cf, ngx_str_t *file)
1143 { 1147 {