Welcome! Log In Create A New Profile

Advanced

[PATCH 1 of 2] SSL: let it build against BoringSSL

Piotr Sikora
July 30, 2014 07:48AM
# HG changeset patch
# User Piotr Sikora <piotr@cloudflare.com>
# Date 1406719935 25200
# Wed Jul 30 04:32:15 2014 -0700
# Node ID 45ed2f1f0a6a568b6e9bfe31a28172c1ebcf5d8c
# Parent 4d092aa2f4637ce50284d2accd99a8e91aae2b4c
SSL: let it build against BoringSSL.

This change adds support for using BoringSSL as a drop-in replacement
for OpenSSL without adding support for any of the BoringSSL-specific
features.

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

diff -r 4d092aa2f463 -r 45ed2f1f0a6a src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c Mon Jul 28 12:27:57 2014 -0700
+++ b/src/event/ngx_event_openssl.c Wed Jul 30 04:32:15 2014 -0700
@@ -106,7 +106,9 @@ int ngx_ssl_stapling_index;
ngx_int_t
ngx_ssl_init(ngx_log_t *log)
{
+#ifndef OPENSSL_IS_BORINGSSL
OPENSSL_config(NULL);
+#endif

SSL_library_init();
SSL_load_error_strings();
@@ -217,7 +219,10 @@ ngx_ssl_create(ngx_ssl_t *ssl, ngx_uint_
SSL_CTX_set_options(ssl->ctx, SSL_OP_MSIE_SSLV2_RSA_PADDING);
#endif

+#ifdef SSL_OP_SSLEAY_080_CLIENT_DH_BUG
SSL_CTX_set_options(ssl->ctx, SSL_OP_SSLEAY_080_CLIENT_DH_BUG);
+#endif
+
SSL_CTX_set_options(ssl->ctx, SSL_OP_TLS_D5_BUG);
SSL_CTX_set_options(ssl->ctx, SSL_OP_TLS_BLOCK_PADDING_BUG);

@@ -382,8 +387,13 @@ ngx_ssl_certificate(ngx_conf_t *cf, ngx_
if (--tries) {
n = ERR_peek_error();

+#ifdef OPENSSL_IS_BORINGSSL
+ if (ERR_GET_LIB(n) == ERR_LIB_CIPHER
+ && ERR_GET_REASON(n) == CIPHER_R_BAD_DECRYPT)
+#else
if (ERR_GET_LIB(n) == ERR_LIB_EVP
&& ERR_GET_REASON(n) == EVP_R_BAD_DECRYPT)
+#endif
{
ERR_clear_error();
SSL_CTX_set_default_passwd_cb_userdata(ssl->ctx, ++pwd);

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 0 of 2] SSL: let it build against BorginSSL and LibreSSL (take #3)

Piotr Sikora 560 July 30, 2014 07:48AM

[PATCH 1 of 2] SSL: let it build against BoringSSL

Piotr Sikora 307 July 30, 2014 07:48AM

[PATCH 2 of 2] SSL: let it build against LibreSSL

Piotr Sikora 249 July 30, 2014 07:48AM

Re: [PATCH 0 of 2] SSL: let it build against BorginSSL and LibreSSL (take #3)

Maxim Dounin 294 July 30, 2014 12:44PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 255
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready