Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
39b1a51f
Commit
39b1a51f
authored
Sep 09, 2021
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compile with the latest ngtcp2
parent
a2e2e46a
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
370 deletions
+35
-370
src/shrpx_http3_upstream.cc
src/shrpx_http3_upstream.cc
+2
-2
src/shrpx_quic.cc
src/shrpx_quic.cc
+29
-349
src/shrpx_quic.h
src/shrpx_quic.h
+0
-15
src/shrpx_quic_connection_handler.cc
src/shrpx_quic_connection_handler.cc
+4
-4
No files found.
src/shrpx_http3_upstream.cc
View file @
39b1a51f
...
...
@@ -471,8 +471,8 @@ int handshake_completed(ngtcp2_conn *conn, void *user_data) {
}
// namespace
int
Http3Upstream
::
handshake_completed
()
{
std
::
array
<
uint8_t
,
SHRPX_QUIC_MAX
_TOKENLEN
>
token
;
size_t
tokenlen
=
token
.
size
()
;
std
::
array
<
uint8_t
,
NGTCP2_CRYPTO_MAX_REGULAR
_TOKENLEN
>
token
;
size_t
tokenlen
;
auto
path
=
ngtcp2_conn_get_path
(
conn_
);
auto
worker
=
handler_
->
get_worker
();
...
...
src/shrpx_quic.cc
View file @
39b1a51f
This diff is collapsed.
Click to expand it.
src/shrpx_quic.h
View file @
39b1a51f
...
...
@@ -62,24 +62,9 @@ constexpr size_t SHRPX_QUIC_CID_PREFIXLEN = 8;
constexpr
size_t
SHRPX_QUIC_MAX_UDP_PAYLOAD_SIZE
=
1472
;
constexpr
size_t
SHRPX_QUIC_STATELESS_RESET_SECRETLEN
=
32
;
constexpr
size_t
SHRPX_QUIC_TOKEN_SECRETLEN
=
32
;
constexpr
size_t
SHRPX_QUIC_TOKEN_RAND_DATALEN
=
16
;
constexpr
size_t
SHRPX_QUIC_CONN_CLOSE_PKTLEN
=
256
;
constexpr
size_t
SHRPX_QUIC_STATELESS_RESET_BURST
=
100
;
// SHRPX_QUIC_RETRY_TOKEN_MAGIC is the magic byte of Retry token.
// Sent in plaintext.
constexpr
uint8_t
SHRPX_QUIC_RETRY_TOKEN_MAGIC
=
0xb6
;
constexpr
size_t
SHRPX_QUIC_MAX_RETRY_TOKENLEN
=
/* magic */
1
+
sizeof
(
uint64_t
)
+
NGTCP2_MAX_CIDLEN
+
/* aead tag */
16
+
SHRPX_QUIC_TOKEN_RAND_DATALEN
;
// SHRPX_QUIC_TOKEN_MAGIC is the magic byte of token which is sent in
// NEW_TOKEN frame. Sent in plaintext.
constexpr
uint8_t
SHRPX_QUIC_TOKEN_MAGIC
=
0x36
;
constexpr
size_t
SHRPX_QUIC_MAX_TOKENLEN
=
/* magic */
1
+
sizeof
(
uint64_t
)
+
/* aead tag */
16
+
SHRPX_QUIC_TOKEN_RAND_DATALEN
;
ngtcp2_tstamp
quic_timestamp
();
int
quic_send_packet
(
const
UpstreamAddr
*
faddr
,
const
sockaddr
*
remote_sa
,
...
...
src/shrpx_quic_connection_handler.cc
View file @
39b1a51f
...
...
@@ -152,7 +152,7 @@ int QUICConnectionHandler::handle_packet(const UpstreamAddr *faddr,
auto
&
secret
=
quic_secret
->
token_secret
;
switch
(
hd
.
token
.
base
[
0
])
{
case
SHRPX_QUIC_RETRY_TOKEN_MAGIC
:
case
NGTCP2_CRYPTO_TOKEN_MAGIC_RETRY
:
if
(
verify_retry_token
(
&
odcid
,
hd
.
token
.
base
,
hd
.
token
.
len
,
&
hd
.
dcid
,
&
remote_addr
.
su
.
sa
,
remote_addr
.
len
,
secret
.
data
())
!=
0
)
{
...
...
@@ -178,7 +178,7 @@ int QUICConnectionHandler::handle_packet(const UpstreamAddr *faddr,
tokenlen
=
hd
.
token
.
len
;
break
;
case
SHRPX_QUIC_TOKEN_MAGIC
:
case
NGTCP2_CRYPTO_TOKEN_MAGIC_REGULAR
:
if
(
verify_token
(
hd
.
token
.
base
,
hd
.
token
.
len
,
&
remote_addr
.
su
.
sa
,
remote_addr
.
len
,
secret
.
data
())
!=
0
)
{
if
(
LOG_ENABLED
(
INFO
))
{
...
...
@@ -356,8 +356,8 @@ int QUICConnectionHandler::send_retry(
return
-
1
;
}
std
::
array
<
uint8_t
,
SHRPX_QUIC
_MAX_RETRY_TOKENLEN
>
token
;
size_t
tokenlen
=
token
.
size
()
;
std
::
array
<
uint8_t
,
NGTCP2_CRYPTO
_MAX_RETRY_TOKENLEN
>
token
;
size_t
tokenlen
;
ngtcp2_cid
idcid
,
iscid
;
ngtcp2_cid_init
(
&
idcid
,
ini_dcid
,
ini_dcidlen
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment