comparison src/event/ngx_event_quic.c @ 8202:a4ed2305ad2c quic

ChaCha20 / Poly1305 initial support.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 10 Mar 2020 19:13:09 +0300
parents 5c66dadb1e34
children ec0c44aa2881
comparison
equal deleted inserted replaced
8201:5c66dadb1e34 8202:a4ed2305ad2c
10 10
11 #define quic_version 0xff000018 11 #define quic_version 0xff000018
12 12
13 #define NGX_AES_128_GCM_SHA256 0x1301 13 #define NGX_AES_128_GCM_SHA256 0x1301
14 #define NGX_AES_256_GCM_SHA384 0x1302 14 #define NGX_AES_256_GCM_SHA384 0x1302
15 #define NGX_CHACHA20_POLY1305_SHA256 0x1303
15 16
16 #define NGX_QUIC_IV_LEN 12 17 #define NGX_QUIC_IV_LEN 12
17 18
18 #ifdef OPENSSL_IS_BORINGSSL 19 #ifdef OPENSSL_IS_BORINGSSL
19 #define ngx_quic_cipher_t EVP_AEAD 20 #define ngx_quic_cipher_t EVP_AEAD
2120 ciphers->hp = EVP_aes_256_ctr(); 2121 ciphers->hp = EVP_aes_256_ctr();
2121 ciphers->d = EVP_sha384(); 2122 ciphers->d = EVP_sha384();
2122 len = 32; 2123 len = 32;
2123 break; 2124 break;
2124 2125
2126 case NGX_CHACHA20_POLY1305_SHA256:
2127 #ifdef OPENSSL_IS_BORINGSSL
2128 ciphers->c = EVP_aead_chacha20_poly1305();
2129 #else
2130 ciphers->c = EVP_chacha20_poly1305();
2131 #endif
2132 #ifndef OPENSSL_IS_BORINGSSL
2133 ciphers->hp = EVP_chacha20();
2134 #endif
2135 ciphers->d = EVP_sha256();
2136 len = 32;
2137 break;
2138
2125 default: 2139 default:
2126 return NGX_ERROR; 2140 return NGX_ERROR;
2127 } 2141 }
2128 2142
2129 return len; 2143 return len;