Do not change cipherspec while we have buffered handshake fragments pending

This commit is contained in:
Martin Willi
2010-09-09 14:27:41 +02:00
parent 939c4bf2e8
commit 89821331e0
+2 -2
View File
@@ -393,14 +393,14 @@ METHOD(tls_fragmentation_t, build, status_t,
*type = TLS_ALERT; *type = TLS_ALERT;
return NEED_MORE; return NEED_MORE;
} }
if (!this->output.len)
{
if (this->handshake->cipherspec_changed(this->handshake)) if (this->handshake->cipherspec_changed(this->handshake))
{ {
*type = TLS_CHANGE_CIPHER_SPEC; *type = TLS_CHANGE_CIPHER_SPEC;
*data = chunk_clone(chunk_from_chars(0x01)); *data = chunk_clone(chunk_from_chars(0x01));
return NEED_MORE; return NEED_MORE;
} }
if (!this->output.len)
{
if (!this->handshake->finished(this->handshake)) if (!this->handshake->finished(this->handshake))
{ {
status = build_handshake(this); status = build_handshake(this);