Filter invalid EAP authentication types when enumerating them

Valid authentication types defined by the IETF are 4-253 and 255.
This commit is contained in:
Tobias Brunner
2012-08-31 11:37:45 +02:00
parent eae5616ae6
commit 7cad171da8
2 changed files with 10 additions and 1 deletions
+6
View File
@@ -115,6 +115,12 @@ static bool filter_methods(uintptr_t role, eap_entry_t **entry,
{
return FALSE;
}
if ((*entry)->vendor == 0 &&
((*entry)->type < 4 || (*entry)->type == EAP_EXPANDED ||
(*entry)->type > EAP_EXPERIMENTAL))
{ /* filter invalid types */
return FALSE;
}
if (type)
{
*type = (*entry)->type;
+4 -1
View File
@@ -55,7 +55,10 @@ struct eap_manager_t {
void (*remove_method)(eap_manager_t *this, eap_constructor_t constructor);
/**
* Enumerate the registered EAP methods for the given role.
* Enumerate the registered EAP authentication methods for the given role.
*
* @note Only authentication types are enumerated (e.g. EAP-Identity is not
* even though it is registered as method with this manager).
*
* @param role EAP role of methods to enumerate
* @return enumerator over (eap_type_t type, u_int32_t vendor)