Migrated eap_authenticator to INIT/METHOD macros
This commit is contained in:
@@ -458,11 +458,8 @@ static void build_auth(private_eap_authenticator_t *this, message_t *message,
|
|||||||
chunk_free(&auth_data);
|
chunk_free(&auth_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
METHOD(authenticator_t, process_server, status_t,
|
||||||
* Implementation of authenticator_t.process for a server
|
private_eap_authenticator_t *this, message_t *message)
|
||||||
*/
|
|
||||||
static status_t process_server(private_eap_authenticator_t *this,
|
|
||||||
message_t *message)
|
|
||||||
{
|
{
|
||||||
eap_payload_t *eap_payload;
|
eap_payload_t *eap_payload;
|
||||||
|
|
||||||
@@ -492,11 +489,8 @@ static status_t process_server(private_eap_authenticator_t *this,
|
|||||||
return NEED_MORE;
|
return NEED_MORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
METHOD(authenticator_t, build_server, status_t,
|
||||||
* Implementation of authenticator_t.build for a server
|
private_eap_authenticator_t *this, message_t *message)
|
||||||
*/
|
|
||||||
static status_t build_server(private_eap_authenticator_t *this,
|
|
||||||
message_t *message)
|
|
||||||
{
|
{
|
||||||
if (this->eap_payload)
|
if (this->eap_payload)
|
||||||
{
|
{
|
||||||
@@ -519,11 +513,8 @@ static status_t build_server(private_eap_authenticator_t *this,
|
|||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
METHOD(authenticator_t, process_client, status_t,
|
||||||
* Implementation of authenticator_t.process for a client
|
private_eap_authenticator_t *this, message_t *message)
|
||||||
*/
|
|
||||||
static status_t process_client(private_eap_authenticator_t *this,
|
|
||||||
message_t *message)
|
|
||||||
{
|
{
|
||||||
eap_payload_t *eap_payload;
|
eap_payload_t *eap_payload;
|
||||||
|
|
||||||
@@ -603,11 +594,8 @@ static status_t process_client(private_eap_authenticator_t *this,
|
|||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
METHOD(authenticator_t, build_client, status_t,
|
||||||
* Implementation of authenticator_t.build for a client
|
private_eap_authenticator_t *this, message_t *message)
|
||||||
*/
|
|
||||||
static status_t build_client(private_eap_authenticator_t *this,
|
|
||||||
message_t *message)
|
|
||||||
{
|
{
|
||||||
if (this->eap_payload)
|
if (this->eap_payload)
|
||||||
{
|
{
|
||||||
@@ -623,20 +611,16 @@ static status_t build_client(private_eap_authenticator_t *this,
|
|||||||
return NEED_MORE;
|
return NEED_MORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
METHOD(authenticator_t, is_mutual, bool,
|
||||||
* Implementation of authenticator_t.is_mutual.
|
private_eap_authenticator_t *this)
|
||||||
*/
|
|
||||||
static bool is_mutual(private_eap_authenticator_t *this)
|
|
||||||
{
|
{
|
||||||
/* we don't know yet, but insist on it after EAP is complete */
|
/* we don't know yet, but insist on it after EAP is complete */
|
||||||
this->require_mutual = TRUE;
|
this->require_mutual = TRUE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
METHOD(authenticator_t, destroy, void,
|
||||||
* Implementation of authenticator_t.destroy.
|
private_eap_authenticator_t *this)
|
||||||
*/
|
|
||||||
static void destroy(private_eap_authenticator_t *this)
|
|
||||||
{
|
{
|
||||||
DESTROY_IF(this->method);
|
DESTROY_IF(this->method);
|
||||||
DESTROY_IF(this->eap_payload);
|
DESTROY_IF(this->eap_payload);
|
||||||
@@ -652,25 +636,30 @@ eap_authenticator_t *eap_authenticator_create_builder(ike_sa_t *ike_sa,
|
|||||||
chunk_t received_nonce, chunk_t sent_nonce,
|
chunk_t received_nonce, chunk_t sent_nonce,
|
||||||
chunk_t received_init, chunk_t sent_init)
|
chunk_t received_init, chunk_t sent_init)
|
||||||
{
|
{
|
||||||
private_eap_authenticator_t *this = malloc_thing(private_eap_authenticator_t);
|
private_eap_authenticator_t *this;
|
||||||
|
|
||||||
this->public.authenticator.build = (status_t(*)(authenticator_t*, message_t *message))build_client;
|
INIT(this,
|
||||||
this->public.authenticator.process = (status_t(*)(authenticator_t*, message_t *message))process_client;
|
.public = {
|
||||||
this->public.authenticator.is_mutual = (bool(*)(authenticator_t*))is_mutual;
|
.authenticator = {
|
||||||
this->public.authenticator.destroy = (void(*)(authenticator_t*))destroy;
|
.build = _build_client,
|
||||||
|
.process = _process_client,
|
||||||
this->ike_sa = ike_sa;
|
.is_mutual = _is_mutual,
|
||||||
this->received_init = received_init;
|
.destroy = _destroy,
|
||||||
this->received_nonce = received_nonce;
|
},
|
||||||
this->sent_init = sent_init;
|
},
|
||||||
this->sent_nonce = sent_nonce;
|
.ike_sa = ike_sa,
|
||||||
this->msk = chunk_empty;
|
.received_init = received_init,
|
||||||
this->method = NULL;
|
.received_nonce = received_nonce,
|
||||||
this->eap_payload = NULL;
|
.sent_init = sent_init,
|
||||||
this->eap_complete = FALSE;
|
.sent_nonce = sent_nonce,
|
||||||
this->auth_complete = FALSE;
|
.msk = chunk_empty,
|
||||||
this->eap_identity = NULL;
|
.method = NULL,
|
||||||
this->require_mutual = FALSE;
|
.eap_payload = NULL,
|
||||||
|
.eap_complete = FALSE,
|
||||||
|
.auth_complete = FALSE,
|
||||||
|
.eap_identity = NULL,
|
||||||
|
.require_mutual = FALSE,
|
||||||
|
);
|
||||||
|
|
||||||
return &this->public;
|
return &this->public;
|
||||||
}
|
}
|
||||||
@@ -682,25 +671,30 @@ eap_authenticator_t *eap_authenticator_create_verifier(ike_sa_t *ike_sa,
|
|||||||
chunk_t received_nonce, chunk_t sent_nonce,
|
chunk_t received_nonce, chunk_t sent_nonce,
|
||||||
chunk_t received_init, chunk_t sent_init)
|
chunk_t received_init, chunk_t sent_init)
|
||||||
{
|
{
|
||||||
private_eap_authenticator_t *this = malloc_thing(private_eap_authenticator_t);
|
private_eap_authenticator_t *this;
|
||||||
|
|
||||||
this->public.authenticator.build = (status_t(*)(authenticator_t*, message_t *messageh))build_server;
|
INIT(this,
|
||||||
this->public.authenticator.process = (status_t(*)(authenticator_t*, message_t *message))process_server;
|
.public = {
|
||||||
this->public.authenticator.is_mutual = (bool(*)(authenticator_t*))is_mutual;
|
.authenticator = {
|
||||||
this->public.authenticator.destroy = (void(*)(authenticator_t*))destroy;
|
.build = _build_server,
|
||||||
|
.process = _process_server,
|
||||||
this->ike_sa = ike_sa;
|
.is_mutual = _is_mutual,
|
||||||
this->received_init = received_init;
|
.destroy = _destroy,
|
||||||
this->received_nonce = received_nonce;
|
},
|
||||||
this->sent_init = sent_init;
|
},
|
||||||
this->sent_nonce = sent_nonce;
|
.ike_sa = ike_sa,
|
||||||
this->msk = chunk_empty;
|
.received_init = received_init,
|
||||||
this->method = NULL;
|
.received_nonce = received_nonce,
|
||||||
this->eap_payload = NULL;
|
.sent_init = sent_init,
|
||||||
this->eap_complete = FALSE;
|
.sent_nonce = sent_nonce,
|
||||||
this->auth_complete = FALSE;
|
.msk = chunk_empty,
|
||||||
this->eap_identity = NULL;
|
.method = NULL,
|
||||||
this->require_mutual = FALSE;
|
.eap_payload = NULL,
|
||||||
|
.eap_complete = FALSE,
|
||||||
|
.auth_complete = FALSE,
|
||||||
|
.eap_identity = NULL,
|
||||||
|
.require_mutual = FALSE,
|
||||||
|
);
|
||||||
|
|
||||||
return &this->public;
|
return &this->public;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user