Properly send empty EAP-TLS messages

This commit is contained in:
Martin Willi
2010-08-03 15:39:25 +02:00
parent 51313a39d1
commit 3e7e777941
+3
View File
@@ -215,6 +215,8 @@ static eap_payload_t *read_buf(private_eap_tls_t *this, u_int8_t identifier)
pkt->type = EAP_TLS; pkt->type = EAP_TLS;
pkt->flags = 0; pkt->flags = 0;
if (this->output.len)
{
start = (char*)(pkt + 1); start = (char*)(pkt + 1);
if (this->outpos == 0) if (this->outpos == 0)
{ /* first fragment */ { /* first fragment */
@@ -239,6 +241,7 @@ static eap_payload_t *read_buf(private_eap_tls_t *this, u_int8_t identifier)
chunk_free(&this->output); chunk_free(&this->output);
this->outpos = 0; this->outpos = 0;
} }
}
htoun16(&pkt->length, pkt_len); htoun16(&pkt->length, pkt_len);
return eap_payload_create_data(chunk_create(buf, pkt_len)); return eap_payload_create_data(chunk_create(buf, pkt_len));
} }