Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2016-10-18 17:25:38 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2016-10-18 17:25:38 +0300
commit789abf2b8cfd184555a09f7001b59e82c003c43c (patch)
tree87c7d8c1adffeb10a35d2c0a46bfb13b562a7add
parenta3f3471fa35fd5796d8b81ff7e798705a792b232 (diff)
SSL: default DH parameters compatible with OpenSSL 1.1.0.
This is a direct commit to stable as there is no corresponding code in mainline, default DH parameters were removed in 1aa9650a8154.
-rw-r--r--src/event/ngx_event_openssl.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
index 3629e55bc..a3160b4b8 100644
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -951,6 +951,8 @@ ngx_ssl_dhparam(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *file)
return NGX_ERROR;
}
+#if OPENSSL_VERSION_NUMBER < 0x10100005L
+
dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
@@ -960,6 +962,23 @@ ngx_ssl_dhparam(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *file)
return NGX_ERROR;
}
+#else
+ {
+ BIGNUM *p, *g;
+
+ p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
+ g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
+
+ if (p == NULL || g == NULL || !DH_set0_pqg(dh, p, NULL, g)) {
+ ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0, "BN_bin2bn() failed");
+ DH_free(dh);
+ BN_free(p);
+ BN_free(g);
+ return NGX_ERROR;
+ }
+ }
+#endif
+
SSL_CTX_set_tmp_dh(ssl->ctx, dh);
DH_free(dh);