From: Sergey Kandaurov Date: Tue, 10 Mar 2020 16:13:09 +0000 (+0300) Subject: ChaCha20 / Poly1305 initial support. X-Git-Tag: release-1.25.0~4^2~907 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=7e417544bbffdb05e3ef097fe7b7d49e5d85d1d8;p=nginx.git ChaCha20 / Poly1305 initial support. --- diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c index f62789da9..b7595e8bf 100644 --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -12,6 +12,7 @@ #define NGX_AES_128_GCM_SHA256 0x1301 #define NGX_AES_256_GCM_SHA384 0x1302 +#define NGX_CHACHA20_POLY1305_SHA256 0x1303 #define NGX_QUIC_IV_LEN 12 @@ -2122,6 +2123,19 @@ ngx_quic_ciphers(ngx_connection_t *c, ngx_quic_ciphers_t *ciphers, len = 32; break; + case NGX_CHACHA20_POLY1305_SHA256: +#ifdef OPENSSL_IS_BORINGSSL + ciphers->c = EVP_aead_chacha20_poly1305(); +#else + ciphers->c = EVP_chacha20_poly1305(); +#endif +#ifndef OPENSSL_IS_BORINGSSL + ciphers->hp = EVP_chacha20(); +#endif + ciphers->d = EVP_sha256(); + len = 32; + break; + default: return NGX_ERROR; }