Skip to content

Commit

Permalink
QUIC: Fix no-quic builds
Browse files Browse the repository at this point in the history
Fix extension list
Use SSL_IS_QUIC()

Do a trivial change to make code closer to upstreaam
(i.e. slightly better diff).
  • Loading branch information
tmshort committed Oct 11, 2022
1 parent 2110d9f commit 95d368c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Configure
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ my @disable_cascades = (
"ssl3-method" => [ "ssl3" ],
"zlib" => [ "zlib-dynamic" ],
"des" => [ "mdc2" ],
"ec" => [ "ecdsa", "ecdh" ],
"ec" => [ "ecdsa", "ecdh", "quic" ],

"dgram" => [ "dtls", "sctp" ],
"sock" => [ "dgram" ],
Expand Down
1 change: 1 addition & 0 deletions ssl/statem/extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ static const EXTENSION_DEFINITION ext_defs[] = {
},
#else
INVALID_EXTENSION,
INVALID_EXTENSION,
#endif
{
/* Must be immediately before pre_shared_key */
Expand Down
2 changes: 1 addition & 1 deletion ssl/statem/extensions_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,7 @@ int tls_parse_stoc_early_data(SSL *s, PACKET *pkt, unsigned int context,
* QUIC server must send 0xFFFFFFFF or it's a PROTOCOL_VIOLATION
* per draft-ietf-quic-tls-27 S4.5
*/
if (s->quic_method != NULL && max_early_data != 0xFFFFFFFF) {
if (SSL_IS_QUIC(s) && max_early_data != 0xFFFFFFFF) {
SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_F_TLS_PARSE_STOC_EARLY_DATA,
SSL_R_INVALID_MAX_EARLY_DATA);
return 0;
Expand Down
4 changes: 2 additions & 2 deletions ssl/statem/extensions_srvr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1971,12 +1971,12 @@ EXT_RETURN tls_construct_stoc_early_data(SSL *s, WPACKET *pkt,
if (context == SSL_EXT_TLS1_3_NEW_SESSION_TICKET) {
uint32_t max_early_data = s->max_early_data;

if (max_early_data == 0)
if (s->max_early_data == 0)
return EXT_RETURN_NOT_SENT;

#ifndef OPENSSL_NO_QUIC
/* QUIC server must always send 0xFFFFFFFF, per draft-ietf-quic-tls-27 S4.5 */
if (s->quic_method != NULL)
if (SSL_IS_QUIC(s))
max_early_data = 0xFFFFFFFF;
#endif

Expand Down
2 changes: 1 addition & 1 deletion ssl/statem/statem_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ int ossl_statem_client_construct_message(SSL *s, WPACKET *pkt,
case TLS_ST_CW_END_OF_EARLY_DATA:
#ifndef OPENSSL_NO_QUIC
/* QUIC does not send EndOfEarlyData, draft-ietf-quic-tls-24 S8.3 */
if (s->quic_method != NULL) {
if (SSL_IS_QUIC(s)) {
*confunc = NULL;
*mt = SSL3_MT_DUMMY;
break;
Expand Down

0 comments on commit 95d368c

Please sign in to comment.