#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include "common.h"
#include "milenage.h"
Include dependency graph for hlr_auc_gw.c:
Go to the source code of this file.
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
This is an example implementation of the EAP-SIM/AKA database/authentication gateway interface to HLR/AuC. It is expected to be replaced with an implementation of SS7 gateway to GSM/UMTS authentication center (HLR/AuC) or a local implementation of SIM triplet and AKA authentication data generator.
hostapd will send SIM/AKA authentication queries over a UNIX domain socket to and external program, e.g., this hlr_auc_gw. This interface uses simple text-based format:
EAP-SIM / GSM triplet query/response: SIM-REQ-AUTH <imsi> <max_chal> SIM-RESP-AUTH <imsi> Kc1:SRES1:RAND1 Kc2:SRES2:RAND2 [Kc3:SRES3:RAND3] SIM-RESP-AUTH <imsi> FAILURE
EAP-AKA / UMTS query/response: AKA-REQ-AUTH <imsi> AKA-RESP-AUTH <imsi> <rand> <autn> <ik> <ck> <res> AKA-RESP-AUTH <imsi> FAILURE
EAP-AKA / UMTS AUTS (re-synchronization): AKA-AUTS <imsi> <auts> <rand>
IMSI and max_chal are sent as an ASCII string, Kc/SRES/RAND/AUTN/IK/CK/RES/AUTS as hex strings.
The example implementation here reads GSM authentication triplets from a text file in IMSI:Kc:SRES:RAND format, IMSI in ASCII, other fields as hex strings. This is used to simulate an HLR/AuC. As such, it is not very useful for real life authentication, but it is useful both as an example implementation and for EAP-SIM testing.
Definition in file hlr_auc_gw.c.