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:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user