dirty WIP
This commit is contained in:
parent
9852101624
commit
a0c13fba99
|
@ -22,4 +22,5 @@ libstrongswan_osmo_epdg_la_SOURCES = \
|
||||||
osmo_epdg_listener.h osmo_epdg_listener.c \
|
osmo_epdg_listener.h osmo_epdg_listener.c \
|
||||||
gsup_client.h gsup_client.c \
|
gsup_client.h gsup_client.c \
|
||||||
ipa_client.h ipa_client.c \
|
ipa_client.h ipa_client.c \
|
||||||
osmo_epdg_utils.h osmo_epdg_utils.c
|
osmo_epdg_utils.h osmo_epdg_utils.c \
|
||||||
|
osmo_epdg_db.h osmo_epdg_db.c
|
||||||
|
|
|
@ -20,8 +20,11 @@
|
||||||
|
|
||||||
#include <daemon.h>
|
#include <daemon.h>
|
||||||
#include <plugins/plugin.h>
|
#include <plugins/plugin.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <osmocom/gsm/apn.h>
|
||||||
|
|
||||||
#include "osmo_epdg_plugin.h"
|
#include "osmo_epdg_plugin.h"
|
||||||
#include "osmo_epdg_listener.h"
|
#include "osmo_epdg_listener.h"
|
||||||
#include "osmo_epdg_utils.h"
|
#include "osmo_epdg_utils.h"
|
||||||
|
@ -85,7 +88,9 @@ METHOD(listener_t, authorize, bool,
|
||||||
bool final, bool *success)
|
bool final, bool *success)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
identification_t* imsi_id;
|
||||||
char apn[APN_MAXLEN];
|
char apn[APN_MAXLEN];
|
||||||
|
char imsi[16] = {0};
|
||||||
DBG1(DBG_NET, "Authorized: uniq 0x%08x, name %s final: %d, eap: %d!",
|
DBG1(DBG_NET, "Authorized: uniq 0x%08x, name %s final: %d, eap: %d!",
|
||||||
ike_sa->get_unique_id(ike_sa),
|
ike_sa->get_unique_id(ike_sa),
|
||||||
ike_sa->get_name(ike_sa),
|
ike_sa->get_name(ike_sa),
|
||||||
|
@ -97,8 +102,21 @@ METHOD(listener_t, authorize, bool,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
imsi_id = ike_sa->get_other_id(ike_sa);
|
||||||
|
if (!imsi_id)
|
||||||
|
{
|
||||||
|
DBG1(DBG_NET, "epdg: authorize: Can't get EAP identity.");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (get_imsi(imsi_id, imsi, sizeof(imsi) - 1))
|
||||||
|
{
|
||||||
|
DBG1(DBG_NET, "epdg: authorize: Can't find IMSI in EAP identity.");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
apn[0] = 0;
|
apn[0] = 0;
|
||||||
ret = get_apn(sa, apn, APN_MAXLEN);
|
ret = get_apn(ike_sa, apn, APN_MAXLEN);
|
||||||
if (!ret && ret != -EINVAL)
|
if (!ret && ret != -EINVAL)
|
||||||
{
|
{
|
||||||
DBG1(DBG_NET, "epdg_listener: Tunnel Request: Couldn't get APN!");
|
DBG1(DBG_NET, "epdg_listener: Tunnel Request: Couldn't get APN!");
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#define IPA_ALLOC_SIZE 1200
|
#define IPA_ALLOC_SIZE 1200
|
||||||
|
|
||||||
enum ue_state state {
|
enum ue_state {
|
||||||
/* Initial */
|
/* Initial */
|
||||||
UE_UNAUTHENTICATED,
|
UE_UNAUTHENTICATED,
|
||||||
/* Authenticated */
|
/* Authenticated */
|
||||||
|
|
Loading…
Reference in New Issue