Migrated all SIM/AKA code to libsimaka, use SIM and AKA backend managers registered by name
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/libhydra \
|
||||
-I$(top_srcdir)/src/libcharon
|
||||
-I$(top_srcdir)/src/libcharon -I$(top_srcdir)/src/libsimaka
|
||||
|
||||
AM_CFLAGS = -rdynamic ${pcsclite_CFLAGS}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ static bool decode_imsi_ef(unsigned char *input, int input_len, char *output)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
METHOD(sim_card_t, get_triplet, bool,
|
||||
METHOD(simaka_card_t, get_triplet, bool,
|
||||
private_eap_sim_pcsc_card_t *this, identification_t *id,
|
||||
char rand[SIM_RAND_LEN], char sres[SIM_SRES_LEN], char kc[SIM_KC_LEN])
|
||||
{
|
||||
@@ -351,7 +351,7 @@ METHOD(sim_card_t, get_triplet, bool,
|
||||
return found;
|
||||
}
|
||||
|
||||
METHOD(sim_card_t, get_quintuplet, status_t,
|
||||
METHOD(simaka_card_t, get_quintuplet, status_t,
|
||||
private_eap_sim_pcsc_card_t *this, identification_t *id,
|
||||
char rand[AKA_RAND_LEN], char autn[AKA_AUTN_LEN], char ck[AKA_CK_LEN],
|
||||
char ik[AKA_IK_LEN], char res[AKA_RES_MAX], int *res_len)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef EAP_SIM_PCSC_CARD_H_
|
||||
#define EAP_SIM_PCSC_CARD_H_
|
||||
|
||||
#include <sa/authenticators/eap/sim_manager.h>
|
||||
#include <simaka_card.h>
|
||||
|
||||
typedef struct eap_sim_pcsc_card_t eap_sim_pcsc_card_t;
|
||||
|
||||
@@ -30,9 +30,9 @@ typedef struct eap_sim_pcsc_card_t eap_sim_pcsc_card_t;
|
||||
struct eap_sim_pcsc_card_t {
|
||||
|
||||
/**
|
||||
* Implements sim_card_t interface
|
||||
* Implements simaka_card_t interface
|
||||
*/
|
||||
sim_card_t card;
|
||||
simaka_card_t card;
|
||||
|
||||
/**
|
||||
* Destroy a eap_sim_pcsc_card_t.
|
||||
|
||||
@@ -44,7 +44,13 @@ METHOD(plugin_t, get_name, char*,
|
||||
METHOD(plugin_t, destroy, void,
|
||||
private_eap_sim_pcsc_plugin_t *this)
|
||||
{
|
||||
charon->sim->remove_card(charon->sim, &this->card->card);
|
||||
simaka_manager_t *mgr;
|
||||
|
||||
mgr = lib->get(lib, "sim-manager");
|
||||
if (mgr)
|
||||
{
|
||||
mgr->remove_card(mgr, &this->card->card);
|
||||
}
|
||||
this->card->destroy(this->card);
|
||||
free(this);
|
||||
}
|
||||
@@ -55,6 +61,7 @@ METHOD(plugin_t, destroy, void,
|
||||
plugin_t *eap_sim_pcsc_plugin_create()
|
||||
{
|
||||
private_eap_sim_pcsc_plugin_t *this;
|
||||
simaka_manager_t *mgr;
|
||||
|
||||
INIT(this,
|
||||
.public = {
|
||||
@@ -66,8 +73,12 @@ plugin_t *eap_sim_pcsc_plugin_create()
|
||||
},
|
||||
.card = eap_sim_pcsc_card_create(),
|
||||
);
|
||||
charon->sim->add_card(charon->sim, &this->card->card);
|
||||
|
||||
mgr = lib->get(lib, "sim-manager");
|
||||
if (mgr)
|
||||
{
|
||||
mgr->add_card(mgr, &this->card->card);
|
||||
}
|
||||
return &this->public.plugin;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user