differentiate between TLS messages and EAP-[T]TLS packets in the debug output
This commit is contained in:
parent
07d2b39123
commit
133accfcfd
|
@ -120,7 +120,7 @@ METHOD(eap_method_t, initiate, status_t,
|
||||||
do {
|
do {
|
||||||
pkt.identifier = random();
|
pkt.identifier = random();
|
||||||
} while (!pkt.identifier);
|
} while (!pkt.identifier);
|
||||||
DBG2(DBG_IKE, "sending TLS start packet");
|
DBG2(DBG_IKE, "sending EAP-TLS start packet");
|
||||||
|
|
||||||
*out = eap_payload_create_data(chunk_from_thing(pkt));
|
*out = eap_payload_create_data(chunk_from_thing(pkt));
|
||||||
return NEED_MORE;
|
return NEED_MORE;
|
||||||
|
@ -195,7 +195,7 @@ static eap_payload_t *create_ack(private_eap_tls_t *this, u_int8_t identifier)
|
||||||
.type = EAP_TLS,
|
.type = EAP_TLS,
|
||||||
};
|
};
|
||||||
htoun16(&pkt.length, sizeof(pkt));
|
htoun16(&pkt.length, sizeof(pkt));
|
||||||
DBG2(DBG_IKE, "sending TLS acknowledgement packet");
|
DBG2(DBG_IKE, "sending EAP-TLS acknowledgement packet");
|
||||||
|
|
||||||
return eap_payload_create_data(chunk_from_thing(pkt));
|
return eap_payload_create_data(chunk_from_thing(pkt));
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ static eap_payload_t *read_buf(private_eap_tls_t *this, u_int8_t identifier)
|
||||||
pkt_len += EAP_TLS_FRAGMENT_LEN;
|
pkt_len += EAP_TLS_FRAGMENT_LEN;
|
||||||
memcpy(start, this->output.ptr + this->outpos, EAP_TLS_FRAGMENT_LEN);
|
memcpy(start, this->output.ptr + this->outpos, EAP_TLS_FRAGMENT_LEN);
|
||||||
this->outpos += EAP_TLS_FRAGMENT_LEN;
|
this->outpos += EAP_TLS_FRAGMENT_LEN;
|
||||||
DBG2(DBG_IKE, "sending TLS packet fragment");
|
DBG2(DBG_IKE, "sending EAP-TLS packet fragment");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -240,12 +240,12 @@ static eap_payload_t *read_buf(private_eap_tls_t *this, u_int8_t identifier)
|
||||||
this->output.len - this->outpos);
|
this->output.len - this->outpos);
|
||||||
chunk_free(&this->output);
|
chunk_free(&this->output);
|
||||||
this->outpos = 0;
|
this->outpos = 0;
|
||||||
DBG2(DBG_IKE, "sending TLS packet");
|
DBG2(DBG_IKE, "sending EAP-TLS packet");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DBG2(DBG_IKE, "sending TLS acknowledgement packet");
|
DBG2(DBG_IKE, "sending EAP-TLS acknowledgement packet");
|
||||||
}
|
}
|
||||||
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));
|
||||||
|
|
|
@ -121,7 +121,7 @@ METHOD(eap_method_t, initiate, status_t,
|
||||||
do {
|
do {
|
||||||
pkt.identifier = random();
|
pkt.identifier = random();
|
||||||
} while (!pkt.identifier);
|
} while (!pkt.identifier);
|
||||||
DBG2(DBG_IKE, "sending TLS start packet");
|
DBG2(DBG_IKE, "sending EAP-TLS start packet");
|
||||||
|
|
||||||
*out = eap_payload_create_data(chunk_from_thing(pkt));
|
*out = eap_payload_create_data(chunk_from_thing(pkt));
|
||||||
return NEED_MORE;
|
return NEED_MORE;
|
||||||
|
@ -196,7 +196,7 @@ static eap_payload_t *create_ack(private_eap_ttls_t *this, u_int8_t identifier)
|
||||||
.type = EAP_TTLS,
|
.type = EAP_TTLS,
|
||||||
};
|
};
|
||||||
htoun16(&pkt.length, sizeof(pkt));
|
htoun16(&pkt.length, sizeof(pkt));
|
||||||
DBG2(DBG_IKE, "sending TLS acknowledgement packet");
|
DBG2(DBG_IKE, "sending EAP-TLS acknowledgement packet");
|
||||||
|
|
||||||
return eap_payload_create_data(chunk_from_thing(pkt));
|
return eap_payload_create_data(chunk_from_thing(pkt));
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ static eap_payload_t *read_buf(private_eap_ttls_t *this, u_int8_t identifier)
|
||||||
pkt_len += EAP_TTLS_FRAGMENT_LEN;
|
pkt_len += EAP_TTLS_FRAGMENT_LEN;
|
||||||
memcpy(start, this->output.ptr + this->outpos, EAP_TTLS_FRAGMENT_LEN);
|
memcpy(start, this->output.ptr + this->outpos, EAP_TTLS_FRAGMENT_LEN);
|
||||||
this->outpos += EAP_TTLS_FRAGMENT_LEN;
|
this->outpos += EAP_TTLS_FRAGMENT_LEN;
|
||||||
DBG2(DBG_IKE, "sending TLS packet fragment");
|
DBG2(DBG_IKE, "sending EAP-TLS packet fragment");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -241,12 +241,12 @@ static eap_payload_t *read_buf(private_eap_ttls_t *this, u_int8_t identifier)
|
||||||
this->output.len - this->outpos);
|
this->output.len - this->outpos);
|
||||||
chunk_free(&this->output);
|
chunk_free(&this->output);
|
||||||
this->outpos = 0;
|
this->outpos = 0;
|
||||||
DBG2(DBG_IKE, "sending TLS packet");
|
DBG2(DBG_IKE, "sending EAP-TLS packet");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DBG2(DBG_IKE, "sending TLS acknowledgement packet");
|
DBG2(DBG_IKE, "sending EAP-TLS acknowledgement packet");
|
||||||
}
|
}
|
||||||
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));
|
||||||
|
@ -338,7 +338,7 @@ METHOD(eap_method_t, process, status_t,
|
||||||
if (data.len < sizeof(eap_ttls_packet_t) ||
|
if (data.len < sizeof(eap_ttls_packet_t) ||
|
||||||
untoh16(&pkt->length) != data.len)
|
untoh16(&pkt->length) != data.len)
|
||||||
{
|
{
|
||||||
DBG1(DBG_IKE, "invalid EAP-TTLS packet length");
|
DBG1(DBG_IKE, "invalid EAP-TLS packet length");
|
||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
if (pkt->flags & EAP_TTLS_START)
|
if (pkt->flags & EAP_TTLS_START)
|
||||||
|
|
Loading…
Reference in New Issue