Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openssl 3.0.1+quic #69

Merged
merged 58 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f470d67
QUIC: Add support for BoringSSL QUIC APIs
tmshort Apr 12, 2019
d07fa3a
QUIC: New method to get QUIC secret length
tmshort Jun 14, 2019
af38134
QUIC: Make temp secret names less confusing
tmshort Aug 15, 2019
8dba338
QUIC: Move QUIC transport params to encrypted extensions
tmshort Aug 15, 2019
422df74
QUIC: Use proper secrets for handshake
tmshort Aug 15, 2019
f12ad45
QUIC: Handle partial handshake messages
tmshort Aug 15, 2019
368a7f4
QUIC: Fix duplicate word in docs
tmshort Aug 26, 2019
ef29a4c
QUIC: Fix quic_transport constructors/parsers
tmshort Aug 26, 2019
0d4bcd7
QUIC: Reset init state in SSL_process_quic_post_handshake()
tmshort Aug 29, 2019
e1ba657
QUIC: Don't process an incomplete message
tmshort Aug 29, 2019
4bada87
QUIC: Quick fix: s2c to c2s for early secret
tmshort Aug 30, 2019
599b2ec
QUIC: Add client early traffic secret storage
tmshort Aug 30, 2019
2c89fa0
QUIC: Add OPENSSL_NO_QUIC wrapper
tmshort Aug 30, 2019
5bb60dc
QUIC: Correctly disable middlebox compat
tmshort Aug 30, 2019
f450513
QUIC: Move QUIC code out of tls13_change_cipher_state()
tmshort Aug 30, 2019
280a705
QUIC: Tweeks to quic_change_cipher_state()
tmshort Aug 30, 2019
ad5d1f2
QUIC: Add support for more secrets
tmshort Sep 24, 2019
9b6b16f
QUIC: Fix resumption secret
tmshort Nov 12, 2019
33ff3a4
QUIC: Handle EndOfEarlyData and MaxEarlyData
tmshort Nov 13, 2019
305890f
QUIC: Fall-through for 0RTT
tmshort Jan 7, 2020
b67cfdf
QUIC: Some cleanup for the main QUIC changes
kaduk Apr 22, 2020
48c828f
QUIC: Prevent KeyUpdate for QUIC
kaduk May 11, 2020
51b9a60
QUIC: Test KeyUpdate rejection
kaduk May 11, 2020
853961b
QUIC: Buffer all provided quic data
kaduk Aug 31, 2020
eda6441
QUIC: Enforce consistent encryption level for handshake messages
kaduk Sep 1, 2020
bd8dd06
QUIC: add v1 quic_transport_parameters
tmshort Dec 12, 2020
dee69a2
QUIC: return success when no post-handshake data
tmshort Jan 5, 2021
e8f8cea
QUIC: __owur makes no sense for void return values
kaduk Jan 15, 2021
53922b0
QUIC: remove SSL_R_BAD_DATA_LENGTH (unused)
tmshort Feb 19, 2021
b6160f7
QUIC: Update shared library version
tmshort Mar 3, 2021
a0ecaa5
QUIC: Swap around README files
tmshort Mar 3, 2021
cb027a6
QUIC: Fix 3.0.0 GitHub CI
tmshort Mar 3, 2021
18f881f
QUIC: SSLerr() -> ERR_raise(ERR_LIB_SSL)
tmshort Mar 3, 2021
810c601
QUIC: Add compile/run-time checking for QUIC
tmshort Mar 5, 2021
eb56ce1
QUIC: Add early data support (#11)
tatsuhiro-t Mar 11, 2021
c5be7cb
QUIC: Make SSL_provide_quic_data accept 0 length data (#13)
tatsuhiro-t Mar 11, 2021
df88101
QUIC: Process multiple post-handshake messages in a single call (#16)
tatsuhiro-t Mar 12, 2021
a87f2c8
QUIC: Tighten up some language in SSL_CTX_set_quic_method.pod (#18)
kaduk Mar 12, 2021
25ea4f8
QUIC: Fix typo in README.md (#19)
NanXiao Mar 15, 2021
d3242f7
QUIC: Fix CI (#20)
tmshort Mar 18, 2021
a892801
QUIC: Break up header/body processing
tmshort May 6, 2021
f3862ea
QUIC: Fix make doc-nits
tmshort Jun 24, 2021
eeb6e01
QUIC: Fix make md-nits
tmshort Jun 24, 2021
c753a59
QUIC: Check for FIPS checksum changes
tmshort Jul 9, 2021
64d6329
QUIC: Don't muck with FIPS checksums
tmshort Jul 9, 2021
6ff733d
QUIC: README.md fixups
tmshort Jul 29, 2021
f4d0587
QUIC: Update RFC references
tmshort Sep 7, 2021
e8e0cf6
QUIC: revert white-space change
tmshort Sep 7, 2021
b292c4c
QUIC: update copyrights
tmshort Sep 7, 2021
f2fb2ea
QUIC: update SSL_provide_quic_data() documentation
kaduk Sep 7, 2021
13e428a
QUIC: expound on what DoS attacks QUIC avoids
kaduk Sep 7, 2021
88b01db
QUIC: remove SSL_get_current_cipher() reference
kaduk Sep 7, 2021
c9a8b53
QUIC: use SSL_IS_QUIC() in more places
kaduk Sep 7, 2021
ac0bf0e
QUIC: Error when non-empty session_id in CH (fixes #29)
tmshort Oct 18, 2021
abede8b
QUIC: Update SSL_clear() to clear quic data
tmshort Oct 19, 2021
0649de6
QUIC: Better SSL_clear()
tmshort Oct 29, 2021
05645aa
QUIC: Update README
tmshort Nov 2, 2021
df572f6
fixup! QUIC: Update README
tmshort Dec 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
QUIC: Handle partial handshake messages
  • Loading branch information
tmshort committed Dec 14, 2021
commit f12ad4570ef283f9e6a4a8dde36bd6d873162dc8
1 change: 1 addition & 0 deletions ssl/ssl_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,7 @@ typedef struct cert_pkey_st CERT_PKEY;
struct quic_data_st {
struct quic_data_st *next;
OSSL_ENCRYPTION_LEVEL level;
size_t offset;
size_t length;
};
typedef struct quic_data_st QUIC_DATA;
Expand Down
28 changes: 22 additions & 6 deletions ssl/ssl_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,26 @@ int SSL_provide_quic_data(SSL *ssl, OSSL_ENCRYPTION_LEVEL level,
QUIC_DATA *qd;
const uint8_t *p = data + 1;

/* Check for an incomplete block */
qd = ssl->quic_input_data_tail;
if (qd != NULL) {
l = qd->length - qd->offset;
if (l != 0) {
/* we still need to copy `l` bytes into the last data block */
if (l > len)
l = len;
memcpy((char*)(qd+1) + qd->offset, data, l);
qd->offset += l;
len -= l;
data += l;
continue;
}
}

n2l3(p, l);
l += SSL3_HM_HEADER_LENGTH;

if (l > len) {
SSLerr(SSL_F_SSL_PROVIDE_QUIC_DATA, SSL_R_BAD_DATA_LENGTH);
return 0;
}

qd = OPENSSL_malloc(sizeof(QUIC_DATA) + l);
qd = OPENSSL_zalloc(sizeof(QUIC_DATA) + l);
if (qd == NULL) {
SSLerr(SSL_F_SSL_PROVIDE_QUIC_DATA, ERR_R_INTERNAL_ERROR);
return 0;
Expand All @@ -131,6 +142,11 @@ int SSL_provide_quic_data(SSL *ssl, OSSL_ENCRYPTION_LEVEL level,
qd->next = NULL;
qd->length = l;
qd->level = level;
/* partial data received? */
if (l > len)
l = len;
qd->offset = l;

memcpy((void*)(qd + 1), data, l);
if (ssl->quic_input_data_tail != NULL)
ssl->quic_input_data_tail->next = qd;
Expand Down