Mercurial > hg > nginx
comparison src/event/ngx_event_quic_transport.c @ 8422:90b02ff6b003 quic
Compatibility with BoringSSL master branch.
Recently BoringSSL introduced SSL_set_quic_early_data_context()
that serves as an additional constrain to enable 0-RTT in QUIC.
Relevant changes:
* https://boringssl.googlesource.com/boringssl/+/7c52299%5E!/
* https://boringssl.googlesource.com/boringssl/+/8519432%5E!/
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 01 Jun 2020 19:53:13 +0300 |
parents | c206233d9c29 |
children | c70446e3d771 |
comparison
equal
deleted
inserted
replaced
8421:c206233d9c29 | 8422:90b02ff6b003 |
---|---|
1614 return p - start; | 1614 return p - start; |
1615 } | 1615 } |
1616 | 1616 |
1617 | 1617 |
1618 ssize_t | 1618 ssize_t |
1619 ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp) | 1619 ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp, |
1620 size_t *clen) | |
1620 { | 1621 { |
1621 u_char *p; | 1622 u_char *p; |
1622 size_t len; | 1623 size_t len; |
1623 | 1624 |
1624 #define ngx_quic_tp_len(id, value) \ | 1625 #define ngx_quic_tp_len(id, value) \ |
1645 p = ngx_cpymem(p, value.data, value.len); \ | 1646 p = ngx_cpymem(p, value.data, value.len); \ |
1646 } while (0) | 1647 } while (0) |
1647 | 1648 |
1648 p = pos; | 1649 p = pos; |
1649 | 1650 |
1650 len = ngx_quic_tp_len(NGX_QUIC_TP_ACTIVE_CONNECTION_ID_LIMIT, | 1651 len = ngx_quic_tp_len(NGX_QUIC_TP_INITIAL_MAX_DATA, tp->initial_max_data); |
1651 tp->active_connection_id_limit); | |
1652 | |
1653 len += ngx_quic_tp_len(NGX_QUIC_TP_INITIAL_MAX_DATA,tp->initial_max_data); | |
1654 | 1652 |
1655 len += ngx_quic_tp_len(NGX_QUIC_TP_INITIAL_MAX_STREAMS_UNI, | 1653 len += ngx_quic_tp_len(NGX_QUIC_TP_INITIAL_MAX_STREAMS_UNI, |
1656 tp->initial_max_streams_uni); | 1654 tp->initial_max_streams_uni); |
1657 | 1655 |
1658 len += ngx_quic_tp_len(NGX_QUIC_TP_INITIAL_MAX_STREAMS_BIDI, | 1656 len += ngx_quic_tp_len(NGX_QUIC_TP_INITIAL_MAX_STREAMS_BIDI, |
1667 len += ngx_quic_tp_len(NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI, | 1665 len += ngx_quic_tp_len(NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI, |
1668 tp->initial_max_stream_data_uni); | 1666 tp->initial_max_stream_data_uni); |
1669 | 1667 |
1670 len += ngx_quic_tp_len(NGX_QUIC_TP_MAX_IDLE_TIMEOUT, | 1668 len += ngx_quic_tp_len(NGX_QUIC_TP_MAX_IDLE_TIMEOUT, |
1671 tp->max_idle_timeout); | 1669 tp->max_idle_timeout); |
1670 | |
1671 if (clen) { | |
1672 *clen = len; | |
1673 } | |
1674 | |
1675 len += ngx_quic_tp_len(NGX_QUIC_TP_ACTIVE_CONNECTION_ID_LIMIT, | |
1676 tp->active_connection_id_limit); | |
1672 | 1677 |
1673 #if (NGX_QUIC_DRAFT_VERSION >= 28) | 1678 #if (NGX_QUIC_DRAFT_VERSION >= 28) |
1674 len += ngx_quic_tp_strlen(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); | 1679 len += ngx_quic_tp_strlen(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); |
1675 len += ngx_quic_tp_strlen(NGX_QUIC_TP_INITIAL_SCID, tp->initial_scid); | 1680 len += ngx_quic_tp_strlen(NGX_QUIC_TP_INITIAL_SCID, tp->initial_scid); |
1676 | 1681 |
1685 | 1690 |
1686 if (pos == NULL) { | 1691 if (pos == NULL) { |
1687 return len; | 1692 return len; |
1688 } | 1693 } |
1689 | 1694 |
1695 ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_DATA, | |
1696 tp->initial_max_data); | |
1697 | |
1698 ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_STREAMS_UNI, | |
1699 tp->initial_max_streams_uni); | |
1700 | |
1701 ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_STREAMS_BIDI, | |
1702 tp->initial_max_streams_bidi); | |
1703 | |
1704 ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL, | |
1705 tp->initial_max_stream_data_bidi_local); | |
1706 | |
1707 ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, | |
1708 tp->initial_max_stream_data_bidi_remote); | |
1709 | |
1710 ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI, | |
1711 tp->initial_max_stream_data_uni); | |
1712 | |
1713 ngx_quic_tp_vint(NGX_QUIC_TP_MAX_IDLE_TIMEOUT, | |
1714 tp->max_idle_timeout); | |
1715 | |
1690 ngx_quic_tp_vint(NGX_QUIC_TP_ACTIVE_CONNECTION_ID_LIMIT, | 1716 ngx_quic_tp_vint(NGX_QUIC_TP_ACTIVE_CONNECTION_ID_LIMIT, |
1691 tp->active_connection_id_limit); | 1717 tp->active_connection_id_limit); |
1692 | |
1693 ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_DATA, | |
1694 tp->initial_max_data); | |
1695 | |
1696 ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_STREAMS_UNI, | |
1697 tp->initial_max_streams_uni); | |
1698 | |
1699 ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_STREAMS_BIDI, | |
1700 tp->initial_max_streams_bidi); | |
1701 | |
1702 ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL, | |
1703 tp->initial_max_stream_data_bidi_local); | |
1704 | |
1705 ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, | |
1706 tp->initial_max_stream_data_bidi_remote); | |
1707 | |
1708 ngx_quic_tp_vint(NGX_QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI, | |
1709 tp->initial_max_stream_data_uni); | |
1710 | |
1711 ngx_quic_tp_vint(NGX_QUIC_TP_MAX_IDLE_TIMEOUT, | |
1712 tp->max_idle_timeout); | |
1713 | 1718 |
1714 #if (NGX_QUIC_DRAFT_VERSION >= 28) | 1719 #if (NGX_QUIC_DRAFT_VERSION >= 28) |
1715 ngx_quic_tp_str(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); | 1720 ngx_quic_tp_str(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); |
1716 ngx_quic_tp_str(NGX_QUIC_TP_INITIAL_SCID, tp->initial_scid); | 1721 ngx_quic_tp_str(NGX_QUIC_TP_INITIAL_SCID, tp->initial_scid); |
1717 | 1722 |