Separated cipherspec checking and switching, allowing us to defer the second

This commit is contained in:
Martin Willi
2011-12-31 13:14:49 +01:00
parent 7c0c2349a9
commit 4caa380625
4 changed files with 49 additions and 33 deletions
+4 -2
View File
@@ -251,8 +251,9 @@ METHOD(tls_fragmentation_t, process, status_t,
switch (type)
{
case TLS_CHANGE_CIPHER_SPEC:
if (this->handshake->change_cipherspec(this->handshake))
if (this->handshake->cipherspec_changed(this->handshake, TRUE))
{
this->handshake->change_cipherspec(this->handshake, TRUE);
status = NEED_MORE;
break;
}
@@ -397,8 +398,9 @@ METHOD(tls_fragmentation_t, build, status_t,
}
if (!this->output.len)
{
if (this->handshake->cipherspec_changed(this->handshake))
if (this->handshake->cipherspec_changed(this->handshake, FALSE))
{
this->handshake->change_cipherspec(this->handshake, FALSE);
*type = TLS_CHANGE_CIPHER_SPEC;
*data = chunk_clone(chunk_from_chars(0x01));
return NEED_MORE;