Latest update (add quic)
This commit is contained in:
+18
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2015-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -576,6 +576,10 @@ static SUB_STATE_RETURN read_state_machine(SSL *s)
|
||||
* In DTLS we get the whole message in one go - header and body
|
||||
*/
|
||||
ret = dtls_get_message(s, &mt, &len);
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
} else if (SSL_IS_QUIC(s)) {
|
||||
ret = quic_get_message(s, &mt, &len);
|
||||
#endif
|
||||
} else {
|
||||
ret = tls_get_message_header(s, &mt);
|
||||
}
|
||||
@@ -605,8 +609,8 @@ static SUB_STATE_RETURN read_state_machine(SSL *s)
|
||||
return SUB_STATE_ERROR;
|
||||
}
|
||||
|
||||
/* dtls_get_message already did this */
|
||||
if (!SSL_IS_DTLS(s)
|
||||
/* dtls_get_message/quic_get_message already did this */
|
||||
if (!SSL_IS_DTLS(s) && !SSL_IS_QUIC(s)
|
||||
&& s->s3.tmp.message_size > 0
|
||||
&& !grow_init_buf(s, s->s3.tmp.message_size
|
||||
+ SSL3_HM_HEADER_LENGTH)) {
|
||||
@@ -619,8 +623,8 @@ static SUB_STATE_RETURN read_state_machine(SSL *s)
|
||||
/* Fall through */
|
||||
|
||||
case READ_STATE_BODY:
|
||||
if (!SSL_IS_DTLS(s)) {
|
||||
/* We already got this above for DTLS */
|
||||
if (!SSL_IS_DTLS(s) && !SSL_IS_QUIC(s)) {
|
||||
/* We already got this above for DTLS & QUIC */
|
||||
ret = tls_get_message_body(s, &len);
|
||||
if (ret == 0) {
|
||||
/* Could be non-blocking IO */
|
||||
@@ -901,6 +905,15 @@ static SUB_STATE_RETURN write_state_machine(SSL *s)
|
||||
int statem_flush(SSL *s)
|
||||
{
|
||||
s->rwstate = SSL_WRITING;
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
if (SSL_IS_QUIC(s)) {
|
||||
if (!s->quic_method->flush_flight(s)) {
|
||||
/* NOTE: BIO_flush() does not generate an error */
|
||||
SSLerr(SSL_F_STATEM_FLUSH, ERR_R_INTERNAL_ERROR);
|
||||
return 0;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (BIO_flush(s->wbio) <= 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user