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
abcdca91
Commit
abcdca91
authored
May 16, 2017
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Postpone early data processing if CH replay detected
parent
5e59577e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
src/shrpx_connection.cc
src/shrpx_connection.cc
+5
-2
src/shrpx_connection.h
src/shrpx_connection.h
+3
-0
src/shrpx_tls.cc
src/shrpx_tls.cc
+4
-3
No files found.
src/shrpx_connection.cc
View file @
abcdca91
...
...
@@ -145,6 +145,7 @@ void Connection::disconnect() {
tls
.
sct_requested
=
false
;
tls
.
early_data_finish
=
false
;
tls
.
early_cb_called
=
false
;
tls
.
postpone_early_data
=
false
;
}
if
(
fd
!=
-
1
)
{
...
...
@@ -456,7 +457,8 @@ int Connection::tls_handshake() {
// server waits for EndOfEarlyData and Finished message from
// client, which voids the purpose of 0-RTT data. The left
// over of handshake is done through write_tls or read_tls.
if
((
tls
.
handshake_state
==
TLS_CONN_WRITE_STARTED
||
if
(
!
tls
.
postpone_early_data
&&
(
tls
.
handshake_state
==
TLS_CONN_WRITE_STARTED
||
tls
.
wbuf
.
rleft
())
&&
tls
.
earlybuf
.
rleft
())
{
rv
=
1
;
...
...
@@ -478,7 +480,8 @@ int Connection::tls_handshake() {
}
tls
.
early_data_finish
=
true
;
// The same reason stated above.
if
((
tls
.
handshake_state
==
TLS_CONN_WRITE_STARTED
||
if
(
!
tls
.
postpone_early_data
&&
(
tls
.
handshake_state
==
TLS_CONN_WRITE_STARTED
||
tls
.
wbuf
.
rleft
())
&&
tls
.
earlybuf
.
rleft
())
{
rv
=
1
;
...
...
src/shrpx_connection.h
View file @
abcdca91
...
...
@@ -94,6 +94,9 @@ struct TLSConnection {
bool
early_data_finish
;
// true if early_cb gets called.
bool
early_cb_called
;
// true if processing early data should be postponed until handshake
// finishes.
bool
postpone_early_data
;
};
struct
TCPHint
{
...
...
src/shrpx_tls.cc
View file @
abcdca91
...
...
@@ -613,9 +613,10 @@ int early_cb(SSL *ssl, int *al, void *arg) {
conn
->
tls
.
anti_replay_req
=
nullptr
;
if
(
res
.
status_code
!=
0
)
{
// If we cannot add key/value, just disable 0-RTT early data.
// Note that memcached atomically adds key/value.
conn
->
tls
.
early_data_finish
=
true
;
// If we cannot add key/value, just postpone processing 0-RTT
// early data until handshake finishes. Note that memcached
// atomically adds key/value.
conn
->
tls
.
postpone_early_data
=
true
;
}
conn
->
tls
.
handshake_state
=
TLS_CONN_NORMAL
;
...
...
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