summaryrefslogtreecommitdiff
path: root/src/libcharon/plugins/eap_ttls
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2015-10-22 11:43:58 +0200
committerYves-Alexis Perez <corsac@debian.org>2015-10-22 11:43:58 +0200
commit5dca9ea0e2931f0e2a056c7964d311bcc30a01b8 (patch)
tree037f1ec5bb860846938ddcf29771c24e9c529be0 /src/libcharon/plugins/eap_ttls
parentb238cf34df3fe4476ae6b7012e7cb3e9769d4d51 (diff)
downloadvyos-strongswan-5dca9ea0e2931f0e2a056c7964d311bcc30a01b8.tar.gz
vyos-strongswan-5dca9ea0e2931f0e2a056c7964d311bcc30a01b8.zip
Imported Upstream version 5.3.3
Diffstat (limited to 'src/libcharon/plugins/eap_ttls')
-rw-r--r--src/libcharon/plugins/eap_ttls/eap_ttls_peer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libcharon/plugins/eap_ttls/eap_ttls_peer.c b/src/libcharon/plugins/eap_ttls/eap_ttls_peer.c
index 66c9deed8..e0b59a681 100644
--- a/src/libcharon/plugins/eap_ttls/eap_ttls_peer.c
+++ b/src/libcharon/plugins/eap_ttls/eap_ttls_peer.c
@@ -112,6 +112,13 @@ METHOD(tls_application_t, process, status_t,
eap_data = avp_data;
break;
}
+ else if (eap_len > reader->remaining(reader) + avp_data.len)
+ {
+ /* rough size check, ignoring AVP headers in remaining data */
+ DBG1(DBG_IKE, "EAP packet too large for EAP-TTLS AVP(s)");
+ chunk_free(&avp_data);
+ return FAILED;
+ }
else if (avp_data.len == MAX_RADIUS_ATTRIBUTE_SIZE)
{
/* non-standard: EAP packet segmented into multiple AVPs */
@@ -128,7 +135,7 @@ METHOD(tls_application_t, process, status_t,
if (avp_data.len > eap_data.len - eap_pos)
{
- DBG1(DBG_IKE, "AVP size to large to fit into EAP packet");
+ DBG1(DBG_IKE, "AVP size too large to fit into EAP packet");
chunk_free(&avp_data);
chunk_free(&eap_data);
return FAILED;