Mercurial > hg > nginx
comparison src/event/ngx_event_quic_transport.c @ 8634:831d1960826f quic
QUIC: generate default stateless reset token key.
Previously, if quic_stateless_reset_token_key was empty or unspecified,
initial stateless reset token was not generated. However subsequent tokens
were generated with empty key, which resulted in error with certain SSL
libraries, for example OpenSSL.
Now a random 32-byte stateless reset token key is generated if none is
specified in the configuration. As a result, stateless reset tokens are now
generated for all server ids.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Wed, 11 Nov 2020 21:08:48 +0000 |
parents | 45db1b5c1706 |
children | ad7ca043edf5 |
comparison
equal
deleted
inserted
replaced
8633:d8b01c2b8931 | 8634:831d1960826f |
---|---|
1881 if (tp->original_dcid.len) { | 1881 if (tp->original_dcid.len) { |
1882 len += ngx_quic_tp_strlen(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); | 1882 len += ngx_quic_tp_strlen(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); |
1883 } | 1883 } |
1884 #endif | 1884 #endif |
1885 | 1885 |
1886 if (tp->sr_enabled) { | 1886 len += ngx_quic_varint_len(NGX_QUIC_TP_SR_TOKEN); |
1887 len += ngx_quic_varint_len(NGX_QUIC_TP_SR_TOKEN); | 1887 len += ngx_quic_varint_len(NGX_QUIC_SR_TOKEN_LEN); |
1888 len += ngx_quic_varint_len(NGX_QUIC_SR_TOKEN_LEN); | 1888 len += NGX_QUIC_SR_TOKEN_LEN; |
1889 len += NGX_QUIC_SR_TOKEN_LEN; | |
1890 } | |
1891 | 1889 |
1892 if (pos == NULL) { | 1890 if (pos == NULL) { |
1893 return len; | 1891 return len; |
1894 } | 1892 } |
1895 | 1893 |
1933 if (tp->original_dcid.len) { | 1931 if (tp->original_dcid.len) { |
1934 ngx_quic_tp_str(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); | 1932 ngx_quic_tp_str(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); |
1935 } | 1933 } |
1936 #endif | 1934 #endif |
1937 | 1935 |
1938 if (tp->sr_enabled) { | 1936 ngx_quic_build_int(&p, NGX_QUIC_TP_SR_TOKEN); |
1939 ngx_quic_build_int(&p, NGX_QUIC_TP_SR_TOKEN); | 1937 ngx_quic_build_int(&p, NGX_QUIC_SR_TOKEN_LEN); |
1940 ngx_quic_build_int(&p, NGX_QUIC_SR_TOKEN_LEN); | 1938 p = ngx_cpymem(p, tp->sr_token, NGX_QUIC_SR_TOKEN_LEN); |
1941 p = ngx_cpymem(p, tp->sr_token, NGX_QUIC_SR_TOKEN_LEN); | |
1942 } | |
1943 | 1939 |
1944 return p - pos; | 1940 return p - pos; |
1945 } | 1941 } |
1946 | 1942 |
1947 | 1943 |