summaryrefslogtreecommitdiff
path: root/src/charon/encoding/payloads/eap_payload.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2008-02-08 18:04:42 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2008-02-08 18:04:42 +0000
commit73ac0ec24bdf4bf3d82850b80dba4905c3e4f884 (patch)
treef36bb7f5967d4aaeb6621860639df312c1dcad7c /src/charon/encoding/payloads/eap_payload.c
parent61c73fef76f2fb057e3dde2fc4d32e933f22bc74 (diff)
downloadvyos-strongswan-73ac0ec24bdf4bf3d82850b80dba4905c3e4f884.tar.gz
vyos-strongswan-73ac0ec24bdf4bf3d82850b80dba4905c3e4f884.zip
- Updated to new upstream release.
- Updated ja.po.
Diffstat (limited to 'src/charon/encoding/payloads/eap_payload.c')
-rw-r--r--src/charon/encoding/payloads/eap_payload.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/charon/encoding/payloads/eap_payload.c b/src/charon/encoding/payloads/eap_payload.c
index 79ab32fe5..345114af0 100644
--- a/src/charon/encoding/payloads/eap_payload.c
+++ b/src/charon/encoding/payloads/eap_payload.c
@@ -235,11 +235,23 @@ static u_int8_t get_identifier(private_eap_payload_t *this)
/**
* Implementation of eap_payload_t.get_type.
*/
-static eap_type_t get_type(private_eap_payload_t *this)
+static eap_type_t get_type(private_eap_payload_t *this, u_int32_t *vendor)
{
+ eap_type_t type;
+
+ *vendor = 0;
if (this->data.len > 4)
{
- return *(this->data.ptr + 4);
+ type = *(this->data.ptr + 4);
+ if (type != EAP_EXPANDED)
+ {
+ return type;
+ }
+ if (this->data.len >= 12)
+ {
+ *vendor = ntohl(*(u_int32_t*)(this->data.ptr + 4)) & 0x00FFFFFF;
+ return ntohl(*(u_int32_t*)(this->data.ptr + 8));
+ }
}
return 0;
}
@@ -275,7 +287,7 @@ eap_payload_t *eap_payload_create()
this->public.set_data = (void (*) (eap_payload_t *,chunk_t))set_data;
this->public.get_code = (eap_code_t (*) (eap_payload_t*))get_code;
this->public.get_identifier = (u_int8_t (*) (eap_payload_t*))get_identifier;
- this->public.get_type = (eap_type_t (*) (eap_payload_t*))get_type;
+ this->public.get_type = (eap_type_t (*) (eap_payload_t*,u_int32_t*))get_type;
/* private variables */
this->critical = FALSE;
@@ -329,3 +341,4 @@ eap_payload_t *eap_payload_create_nak()
this->set_data(this, data);
return this;
}
+