From 89821331e0be962fcbe6daaacb0b70ae9a30b148 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Thu, 9 Sep 2010 14:27:41 +0200 Subject: Do not change cipherspec while we have buffered handshake fragments pending --- src/libtls/tls_fragmentation.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libtls/tls_fragmentation.c') diff --git a/src/libtls/tls_fragmentation.c b/src/libtls/tls_fragmentation.c index 3ef232806..5a598cfc4 100644 --- a/src/libtls/tls_fragmentation.c +++ b/src/libtls/tls_fragmentation.c @@ -393,14 +393,14 @@ METHOD(tls_fragmentation_t, build, status_t, *type = TLS_ALERT; return NEED_MORE; } - if (this->handshake->cipherspec_changed(this->handshake)) - { - *type = TLS_CHANGE_CIPHER_SPEC; - *data = chunk_clone(chunk_from_chars(0x01)); - return NEED_MORE; - } if (!this->output.len) { + if (this->handshake->cipherspec_changed(this->handshake)) + { + *type = TLS_CHANGE_CIPHER_SPEC; + *data = chunk_clone(chunk_from_chars(0x01)); + return NEED_MORE; + } if (!this->handshake->finished(this->handshake)) { status = build_handshake(this); -- cgit v1.2.3