if (payload->get_type(payload) == PLV2_EAP)
{
eap_payload_t *eap = (eap_payload_t*)payload;
- uint32_t vendor;
eap_type_t type;
+ pen_t vendor;
char method[64] = "";
type = eap->get_type(eap, &vendor);
* @return the new offset or 0 if failed
*/
static size_t extract_type(private_eap_payload_t *this, size_t offset,
- eap_type_t *type, uint32_t *vendor)
+ eap_type_t *type, pen_t *vendor)
{
if (this->data.len > offset)
{
}
METHOD(eap_payload_t, get_type, eap_type_t,
- private_eap_payload_t *this, uint32_t *vendor)
+ private_eap_payload_t *this, pen_t *vendor)
{
eap_type_t type;
type_enumerator_t *this, va_list args)
{
eap_type_t *type;
- uint32_t *vendor;
+ pen_t *vendor;
VA_ARGS_VGET(args, type, vendor);
this->offset = extract_type(this->payload, this->offset, type, vendor);
{
type_enumerator_t *enumerator;
eap_type_t type;
- uint32_t vendor;
+ pen_t vendor;
size_t offset;
offset = extract_type(this, 4, &type, &vendor);
/**
* Write the given type either expanded or not
*/
-static void write_type(bio_writer_t *writer, eap_type_t type, uint32_t vendor,
+static void write_type(bio_writer_t *writer, eap_type_t type, pen_t vendor,
bool expanded)
{
if (expanded)
* Described in header
*/
eap_payload_t *eap_payload_create_nak(uint8_t identifier, eap_type_t type,
- uint32_t vendor, bool expanded)
+ pen_t vendor, bool expanded)
{
enumerator_t *enumerator;
eap_type_t reg_type;
- uint32_t reg_vendor;
+ pen_t reg_vendor;
bio_writer_t *writer;
chunk_t data;
bool added_any = FALSE, found_vendor = FALSE;
* @param vendor pointer receiving vendor identifier
* @return EAP method type, vendor specific if vendor != 0
*/
- eap_type_t (*get_type) (eap_payload_t *this, uint32_t *vendor);
+ eap_type_t (*get_type) (eap_payload_t *this, pen_t *vendor);
/**
* Enumerate the EAP method types contained in an EAP-Nak (i.e. get_type()
* returns EAP_NAK).
*
- * @return enumerator over (eap_type_t type, uint32_t vendor)
+ * @return enumerator over (eap_type_t type, pen_t vendor)
*/
enumerator_t* (*get_types) (eap_payload_t *this);
* @return eap_payload_t object
*/
eap_payload_t *eap_payload_create_nak(uint8_t identifier, eap_type_t type,
- uint32_t vendor, bool expanded);
+ pen_t vendor, bool expanded);
#endif /** EAP_PAYLOAD_H_ @}*/
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_aka_peer_t *this, uint32_t *vendor)
+ private_eap_aka_peer_t *this, pen_t *vendor)
{
*vendor = 0;
return EAP_AKA;
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_aka_server_t *this, uint32_t *vendor)
+ private_eap_aka_server_t *this, pen_t *vendor)
{
*vendor = 0;
return EAP_AKA;
* Load the given EAP method
*/
static eap_method_t *load_method(private_eap_dynamic_t *this,
- eap_type_t type, uint32_t vendor)
+ eap_type_t type, pen_t vendor)
{
eap_method_t *method;
private_eap_dynamic_t *this, eap_payload_t *in, eap_payload_t **out)
{
eap_type_t received_type, type;
- uint32_t received_vendor, vendor;
+ pen_t received_vendor, vendor;
received_type = in->get_type(in, &received_vendor);
if (received_vendor == 0 && received_type == EAP_NAK)
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_dynamic_t *this, uint32_t *vendor)
+ private_eap_dynamic_t *this, pen_t *vendor)
{
if (this->method)
{
{
enumerator_t *enumerator;
eap_type_t type;
- uint32_t vendor;
+ pen_t vendor;
enumerator = charon->eap->create_enumerator(charon->eap, EAP_SERVER);
while (enumerator->enumerate(enumerator, &type, &vendor))
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_gtc_t *this, uint32_t *vendor)
+ private_eap_gtc_t *this, pen_t *vendor)
{
*vendor = 0;
return EAP_GTC;
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_identity_t *this, uint32_t *vendor)
+ private_eap_identity_t *this, pen_t *vendor)
{
*vendor = 0;
return EAP_IDENTITY;
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_md5_t *this, uint32_t *vendor)
+ private_eap_md5_t *this, pen_t *vendor)
{
*vendor = 0;
return EAP_MD5;
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_mschapv2_t *this, uint32_t *vendor)
+ private_eap_mschapv2_t *this, pen_t *vendor)
{
*vendor = 0;
return EAP_MSCHAPV2;
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_peap_t *this, uint32_t *vendor)
+ private_eap_peap_t *this, pen_t *vendor)
{
*vendor = 0;
return EAP_PEAP;
eap_payload_t *in;
eap_code_t code;
eap_type_t type, received_type;
- uint32_t vendor, received_vendor;
+ pen_t vendor, received_vendor;
status = this->avp->process(this->avp, reader, &data,
this->ph1_method->get_identifier(this->ph1_method));
if (received_vendor)
{
DBG1(DBG_IKE, "server requested vendor specific EAP method %d-%d "
- "(id 0x%02X", received_type, received_vendor,
+ "(id 0x%02X)", received_type, received_vendor,
in->get_identifier(in));
}
else
chunk_t data;
eap_code_t code;
eap_type_t type;
- uint32_t vendor;
+ pen_t vendor;
if (this->out)
{
eap_payload_t *in;
eap_code_t code;
eap_type_t type = EAP_NAK, received_type;
- uint32_t vendor, received_vendor;
+ pen_t vendor, received_vendor;
status = this->avp->process(this->avp, reader, &data,
this->ph1_method->get_identifier(this->ph1_method));
chunk_t data;
eap_code_t code;
eap_type_t type;
- uint32_t vendor;
+ pen_t vendor;
if (this->ph2_method == NULL && this->start_phase2 && this->start_phase2_id)
{
/**
* EAP vendor, if any
*/
- uint32_t vendor;
+ pen_t vendor;
/**
* EAP message identifier
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_radius_t *this, uint32_t *vendor)
+ private_eap_radius_t *this, pen_t *vendor)
{
*vendor = this->vendor;
return this->type;
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_sim_peer_t *this, uint32_t *vendor)
+ private_eap_sim_peer_t *this, pen_t *vendor)
{
*vendor = 0;
return EAP_SIM;
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_sim_server_t *this, uint32_t *vendor)
+ private_eap_sim_server_t *this, pen_t *vendor)
{
*vendor = 0;
return EAP_SIM;
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_tls_t *this, uint32_t *vendor)
+ private_eap_tls_t *this, pen_t *vendor)
{
*vendor = 0;
return EAP_TLS;
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_tnc_t *this, uint32_t *vendor)
+ private_eap_tnc_t *this, pen_t *vendor)
{
*vendor = 0;
return this->type;
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_ttls_t *this, uint32_t *vendor)
+ private_eap_ttls_t *this, pen_t *vendor)
{
*vendor = 0;
return EAP_TTLS;
eap_packet_t *pkt;
eap_code_t code;
eap_type_t type, received_type;
- uint32_t vendor, received_vendor;
+ pen_t vendor, received_vendor;
uint16_t eap_len;
size_t eap_pos = 0;
bool concatenated = FALSE;
chunk_t data;
eap_code_t code;
eap_type_t type;
- uint32_t vendor;
+ pen_t vendor;
if (this->method == NULL && this->start_phase2)
{
eap_payload_t *in;
eap_code_t code;
eap_type_t type = EAP_NAK, received_type;
- uint32_t vendor, received_vendor;
+ pen_t vendor, received_vendor;
status = this->avp->process(this->avp, reader, &data);
switch (status)
chunk_t data;
eap_code_t code;
eap_type_t type;
- uint32_t vendor;
+ pen_t vendor;
if (this->method == NULL && this->start_phase2 &&
lib->settings->get_bool(lib->settings,
eap_payload_t *in, *out = NULL;
eap_method_t *method;
eap_type_t eap_type;
- uint32_t eap_vendor;
+ pen_t eap_vendor;
chunk_t data, message = chunk_empty, msk = chunk_empty;
chunk_t user_name = chunk_empty, nas_id = chunk_empty;
identification_t *group = NULL;
eap_payload_t *request, *response;
eap_method_t *frontend;
eap_type_t type;
- uint32_t vendor;
+ pen_t vendor;
status_t status;
if (backend->initiate(backend, &request) != NEED_MORE)
/**
* vendor ID, 0 for default EAP methods
*/
- uint32_t vendor;
+ pen_t vendor;
/**
* Role of the method returned by the constructor, EAP_SERVER or EAP_PEER
};
METHOD(eap_manager_t, add_method, void,
- private_eap_manager_t *this, eap_type_t type, uint32_t vendor,
+ private_eap_manager_t *this, eap_type_t type, pen_t vendor,
eap_role_t role, eap_constructor_t constructor)
{
eap_entry_t *entry = malloc_thing(eap_entry_t);
{
eap_entry_t *entry;
eap_type_t *type;
- uint32_t *vendor;
+ pen_t *vendor;
VA_ARGS_VGET(args, type, vendor);
}
METHOD(eap_manager_t, create_instance, eap_method_t*,
- private_eap_manager_t *this, eap_type_t type, uint32_t vendor,
+ private_eap_manager_t *this, eap_type_t type, pen_t vendor,
eap_role_t role, identification_t *server, identification_t *peer)
{
enumerator_t *enumerator;
* @param role EAP role of the registered method
* @param constructor constructor function, returns an eap_method_t
*/
- void (*add_method)(eap_manager_t *this, eap_type_t type, uint32_t vendor,
+ void (*add_method)(eap_manager_t *this, eap_type_t type, pen_t vendor,
eap_role_t role, eap_constructor_t constructor);
/**
* 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, uint32_t vendor)
+ * @return enumerator over (eap_type_t type, pen_t vendor)
*/
enumerator_t* (*create_enumerator)(eap_manager_t *this, eap_role_t role);
* @return EAP method instance, NULL if no constructor found
*/
eap_method_t* (*create_instance)(eap_manager_t *this, eap_type_t type,
- uint32_t vendor, eap_role_t role,
+ pen_t vendor, eap_role_t role,
identification_t *server,
identification_t *peer);
* @param vendor pointer receiving vendor identifier for type, 0 for none
* @return type of the EAP method
*/
- eap_type_t (*get_type) (eap_method_t *this, uint32_t *vendor);
+ eap_type_t (*get_type) (eap_method_t *this, pen_t *vendor);
/**
* Check if this EAP method authenticates the server.
* load an EAP method
*/
static eap_method_t *load_method(private_eap_authenticator_t *this,
- eap_type_t type, uint32_t vendor, eap_role_t role)
+ eap_type_t type, pen_t vendor, eap_role_t role)
{
identification_t *server, *peer, *aaa;
auth_cfg_t *auth;
auth_cfg_t *auth;
eap_type_t type;
identification_t *id;
- uint32_t vendor;
+ pen_t vendor;
eap_payload_t *out;
char *action;
eap_payload_t *in)
{
eap_type_t type, received_type, conf_type;
- uint32_t vendor, received_vendor, conf_vendor;
+ pen_t vendor, received_vendor, conf_vendor;
eap_payload_t *out;
auth_cfg_t *auth;
eap_payload_t *in)
{
eap_type_t type, conf_type;
- uint32_t vendor, conf_vendor;
+ pen_t vendor, conf_vendor;
auth_cfg_t *auth;
eap_payload_t *out;
identification_t *id;
auth_cfg_t *auth;
keymat_v2_t *keymat;
eap_type_t type;
- uint32_t vendor;
+ pen_t vendor;
auth_payload = (auth_payload_t*)message->get_payload(message,
PLV2_AUTH);
}
if (this->require_mutual && !this->method->is_mutual(this->method))
{ /* we require mutual authentication due to EAP-only */
- uint32_t vendor;
+ pen_t vendor;
DBG1(DBG_IKE, "EAP-only authentication requires a mutual and "
"MSK deriving EAP method, but %N is not",
case EAP_SUCCESS:
{
eap_type_t type;
- uint32_t vendor;
+ pen_t vendor;
auth_cfg_t *cfg;
if (!this->method)
{
if (this->method)
{
- uint32_t vendor;
+ pen_t vendor;
if (this->method->get_type(this->method, &vendor) != EAP_IDENTITY ||
vendor != 0)
enumerator_t *enumerator;
eap_vendor_type_t *result = NULL;
eap_type_t type = 0;
- uint32_t vendor = 0;
+ pen_t vendor = 0;
char *part, *end;
/* parse EAP method string of the form: [eap-]type[-vendor] */
}
errno = 0;
vendor = strtoul(part, &end, 0);
- if (*end != '\0' || errno)
+ if (*end != '\0' || errno || vendor >= PEN_UNASSIGNED)
{
DBG1(DBG_LIB, "invalid EAP vendor: %s", part);
type = 0;
typedef struct eap_vendor_type_t eap_vendor_type_t;
#include <library.h>
+#include <pen/pen.h>
/**
* EAP code, type of an EAP message
/**
* Vendor Id
*/
- uint32_t vendor;
+ pen_t vendor;
};
/**