diff options
author | lloyd <[email protected]> | 2012-01-04 19:12:15 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-01-04 19:12:15 +0000 |
commit | 799ac21b42da667e1b2c6b381468982029524df7 (patch) | |
tree | 45b508272e6a02d89cb23e4fc07717864d0b5db2 /src/tls | |
parent | 550faf230b01c657b5883a35643e8b9865b122ca (diff) |
Remove the support for writing application data before the handshake
completes. The client gets a callback when the handshake is complete
so they can know exactly when it's OK to send.
Diffstat (limited to 'src/tls')
-rw-r--r-- | src/tls/tls_channel.cpp | 15 | ||||
-rw-r--r-- | src/tls/tls_channel.h | 2 |
2 files changed, 3 insertions, 14 deletions
diff --git a/src/tls/tls_channel.cpp b/src/tls/tls_channel.cpp index 28cc8a0a4..d0f5ab1e2 100644 --- a/src/tls/tls_channel.cpp +++ b/src/tls/tls_channel.cpp @@ -173,19 +173,10 @@ void TLS_Channel::read_handshake(byte rec_type, void TLS_Channel::queue_for_sending(const byte buf[], size_t buf_size) { - if(handshake_completed) - { - while(!pre_handshake_write_queue.end_of_data()) - { - SecureVector<byte> q_buf(1024); - const size_t got = pre_handshake_write_queue.read(&q_buf[0], q_buf.size()); - writer.send(APPLICATION_DATA, &q_buf[0], got); - } + if(!handshake_completed) + throw std::invalid_state("Application data cannot be queued before handshake"); - writer.send(APPLICATION_DATA, buf, buf_size); - } - else - pre_handshake_write_queue.write(buf, buf_size); + writer.send(APPLICATION_DATA, buf, buf_size); } void TLS_Channel::alert(Alert_Level alert_level, Alert_Type alert_code) diff --git a/src/tls/tls_channel.h b/src/tls/tls_channel.h index b102fc790..129182150 100644 --- a/src/tls/tls_channel.h +++ b/src/tls/tls_channel.h @@ -90,8 +90,6 @@ class BOTAN_DLL TLS_Channel Record_Writer writer; Record_Reader reader; - SecureQueue pre_handshake_write_queue; - std::vector<X509_Certificate> peer_certs; class Handshake_State* state; |