Commit 8fbd1a22 authored by gauthier's avatar gauthier

branch LG_PRE_RELEASE_0.3 reintegration

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7107 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 059a0a3f
...@@ -60,8 +60,8 @@ typedef struct { ...@@ -60,8 +60,8 @@ typedef struct {
uint8_t kasme[32]; uint8_t kasme[32];
} auc_vector_t; } auc_vector_t;
void RijndaelKeySchedule(u8 key[16]); void RijndaelKeySchedule(const u8 const key[16]);
void RijndaelEncrypt(u8 in[16], u8 out[16]); void RijndaelEncrypt(const u8 const in[16], u8 out[16]);
/* Sequence number functions */ /* Sequence number functions */
struct sqn_ue_s; struct sqn_ue_s;
...@@ -77,18 +77,18 @@ struct random_state_s; ...@@ -77,18 +77,18 @@ struct random_state_s;
void random_init(void); void random_init(void);
void generate_random(uint8_t *random, ssize_t length); void generate_random(uint8_t *random, ssize_t length);
void SetOPc(u8 op_c[16]); void SetOPc(const u8 const op_c[16]);
void f1 ( u8 k[16], u8 rand[16], u8 sqn[6], u8 amf[2], void f1 ( const u8 const k[16], const u8 const rand[16], const u8 const sqn[6], const u8 const amf[2],
u8 mac_a[8] ); u8 mac_a[8] );
void f1star( u8 k[16], u8 rand[16], u8 sqn[6], u8 amf[2], void f1star( const u8 const k[16], const u8 const rand[16], const u8 const sqn[6], const u8 const amf[2],
u8 mac_s[8] ); u8 mac_s[8] );
void f2345 ( u8 k[16], u8 rand[16], void f2345 ( const u8 const k[16], const u8 const rand[16],
u8 res[8], u8 ck[16], u8 ik[16], u8 ak[6] ); u8 res[8], u8 ck[16], u8 ik[16], u8 ak[6] );
void f5star( u8 k[16], u8 rand[16], void f5star( const u8 const k[16], const u8 const rand[16],
u8 ak[6] ); u8 ak[6] );
void generate_autn(u8 sqn[6], u8 ak[6], u8 amf[2], u8 mac_a[8], u8 autn[16]); void generate_autn(const u8 const sqn[6], const u8 const ak[6], const u8 const amf[2], const u8 const mac_a[8], u8 autn[16]);
int generate_vector(uint64_t imsi, uint8_t key[16], uint8_t plmn[3], int generate_vector(uint64_t imsi, uint8_t key[16], uint8_t plmn[3],
uint8_t sqn[6], auc_vector_t *vector); uint8_t sqn[6], auc_vector_t *vector);
......
...@@ -32,12 +32,15 @@ u8 OP[16]= { ...@@ -32,12 +32,15 @@ u8 OP[16]= {
/*--------------------------- prototypes --------------------------*/ /*--------------------------- prototypes --------------------------*/
void ComputeOPc( u8 op_c[16] ); void ComputeOPc( u8 op_c[16] );
void SetOPc(u8 op_c[16]) void SetOPc(const u8 const op_c[16])
{ {
memcpy(OP, op_c, 16); memcpy(OP, op_c, 16);
printf("SetOPc: OP : %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X ",
OP[0],OP[1],OP[2],OP[3],OP[4],OP[5],OP[6],OP[7],
OP[8],OP[9],OP[10],OP[11],OP[12],OP[13],OP[14],OP[15]);
} }
void generate_autn(u8 sqn[6], u8 ak[6], u8 amf[2], u8 mac_a[8], u8 autn[16]) void generate_autn(const u8 const sqn[6], const u8 const ak[6], const u8 const amf[2], const u8 const mac_a[8], u8 autn[16])
{ {
int i; int i;
...@@ -58,7 +61,7 @@ void generate_autn(u8 sqn[6], u8 ak[6], u8 amf[2], u8 mac_a[8], u8 autn[16]) ...@@ -58,7 +61,7 @@ void generate_autn(u8 sqn[6], u8 ak[6], u8 amf[2], u8 mac_a[8], u8 autn[16])
* field AMF. * field AMF.
* *
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
void f1 ( u8 k[16], u8 _rand[16], u8 sqn[6], u8 amf[2], void f1 ( const u8 const k[16], const u8 const _rand[16], const u8 const sqn[6], const u8 const amf[2],
u8 mac_a[8] ) u8 mac_a[8] )
{ {
u8 op_c[16]; u8 op_c[16];
...@@ -113,7 +116,7 @@ void f1 ( u8 k[16], u8 _rand[16], u8 sqn[6], u8 amf[2], ...@@ -113,7 +116,7 @@ void f1 ( u8 k[16], u8 _rand[16], u8 sqn[6], u8 amf[2],
* confidentiality key CK, integrity key IK and anonymity key AK. * confidentiality key CK, integrity key IK and anonymity key AK.
* *
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
void f2345 ( u8 k[16], u8 _rand[16], void f2345 ( const u8 const k[16], const u8 const _rand[16],
u8 res[8], u8 ck[16], u8 ik[16], u8 ak[6] ) u8 res[8], u8 ck[16], u8 ik[16], u8 ak[6] )
{ {
u8 op_c[16]; u8 op_c[16];
...@@ -190,7 +193,7 @@ void f2345 ( u8 k[16], u8 _rand[16], ...@@ -190,7 +193,7 @@ void f2345 ( u8 k[16], u8 _rand[16],
* field AMF. * field AMF.
* *
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
void f1star( u8 k[16], u8 _rand[16], u8 sqn[6], u8 amf[2], void f1star( const u8 const k[16], const u8 const _rand[16], const u8 const sqn[6], const u8 const amf[2],
u8 mac_s[8] ) u8 mac_s[8] )
{ {
u8 op_c[16]; u8 op_c[16];
...@@ -245,7 +248,7 @@ void f1star( u8 k[16], u8 _rand[16], u8 sqn[6], u8 amf[2], ...@@ -245,7 +248,7 @@ void f1star( u8 k[16], u8 _rand[16], u8 sqn[6], u8 amf[2],
* anonymity key AK. * anonymity key AK.
* *
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
void f5star( u8 k[16], u8 _rand[16], void f5star( const u8 const k[16], const u8 const _rand[16],
u8 ak[6] ) u8 ak[6] )
{ {
u8 op_c[16]; u8 op_c[16];
......
...@@ -79,7 +79,7 @@ u8 Xtime[256] = { ...@@ -79,7 +79,7 @@ u8 Xtime[256] = {
* Rijndael key schedule function. Takes 16-byte key and creates * Rijndael key schedule function. Takes 16-byte key and creates
* all Rijndael's internal subkeys ready for encryption. * all Rijndael's internal subkeys ready for encryption.
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
void RijndaelKeySchedule( u8 key[16] ) void RijndaelKeySchedule( const u8 const key[16] )
{ {
u8 roundConst; u8 roundConst;
int i, j; int i, j;
...@@ -188,7 +188,7 @@ void MixColumn(u8 state[4][4]) ...@@ -188,7 +188,7 @@ void MixColumn(u8 state[4][4])
* 16-byte output (using round keys already derived from 16-byte * 16-byte output (using round keys already derived from 16-byte
* key). * key).
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
void RijndaelEncrypt( u8 input[16], u8 output[16] ) void RijndaelEncrypt( const u8 const input[16], u8 output[16] )
{ {
u8 state[4][4]; u8 state[4][4];
int i, r; int i, r;
......
## MySQL mandatory options
MYSQL_server = "127.0.0.1";
MYSQL_user = "hssadmin";
MYSQL_pass = "admin";
MYSQL_db = "oai_db";
## Freediameter options
FD_conf = "../conf/hss_fd.conf";
## MySQL mandatory options
MYSQL_server = "127.0.0.1";
##MYSQL_user = "root";
##MYSQL_pass = "linux";
MYSQL_user = "hssadmin";
MYSQL_pass = "";
MYSQL_db = "oai_db";
## Freediameter options
FD_conf = "/etc/openair-hss/hss_fd.local.conf";
# -------- Local ---------
# Uncomment if the framework cannot resolv it.
Identity = "UBUNTUPC.pft";
#ListenOn = "127.0.0.1";
# TLS configuration (see previous section)
TLS_Cred = "/usr/local/etc/freeDiameter/hss.cert.pem", "/usr/local/etc/freeDiameter/hss.key.pem";
TLS_CA = "/usr/local/etc/freeDiameter/cacert.pem";
# Disable use of TCP protocol (only listen and connect in SCTP)
# Default : TCP enabled
No_TCP;
#No_SCTP;
# Disable use of IPv6 addresses (only IP)
# Default : IPv6 enabled
No_IPv6;
# Limit the number of SCTP streams
SCTP_streams = 15;
NoRelay;
TLS_old_method;
# Core 2 DUO
AppServThreads = 4;
# -------- Extensions ---------
# Uncomment (and create rtd.conf) to specify routing table for this peer.
#LoadExtension = "rt_default.fdx" : "rtd.conf";
# Uncomment (and create acl.conf) to allow incoming connections from other peers.
#LoadExtension = "acl_wl.fdx" : "/usr/local/src/trunk_co/openair-cn/OPENAIRHSS/conf/acl.conf";
# Uncomment to display periodic state information
#LoadExtension = "dbg_monitor.fdx";
# Uncomment to enable an interactive Python interpreter session.
# (see doc/dbg_interactive.py.sample for more information)
#LoadExtension = "dbg_interactive.fdx";
# Load the RFC4005 dictionary objects
#LoadExtension = "dict_nasreq.fdx";
LoadExtension = "dict_nas_mipv6.fdx";
LoadExtension = "dict_s6a.fdx";
# Load RFC4072 dictionary objects
#LoadExtension = "dict_eap.fdx";
# Load the Diameter EAP server extension (requires diameap.conf)
#LoadExtension = "app_diameap.fdx" : "diameap.conf";
# Load the Accounting Server extension (requires app_acct.conf)
#LoadExtension = "app_acct.fdx" : "app_acct.conf";
# -------- Peers ---------
# The framework will actively attempt to establish and maintain a connection
# with the peers listed here.
# For only accepting incoming connections, see the acl_wl.fx extension.
#ConnectPeer = "ubuntu.localdomain" { ConnectTo = "127.0.0.1"; No_TLS; };
#ConnectPeer = "roux.test.fr" { No_TLS; };
# -------- Local ---------
# Uncomment if the framework cannot resolv it.
Identity = "oai.eur";
#ListenOn = "192.168.13.177";
# TLS configuration (see previous section)
TLS_Cred = "conf/hss.cert.pem","conf/hss.key.pem";
TLS_CA = "conf/cacert.pem";
# Disable use of TCP protocol (only listen and connect in SCTP)
# Default : TCP enabled
No_TCP;
#No_SCTP;
# Disable use of IPv6 addresses (only IP)
# Default : IPv6 enabled
No_IPv6;
# Limit the number of SCTP streams
SCTP_streams = 15;
NoRelay;
TLS_old_method;
# Core 2 DUO
AppServThreads = 4;
# -------- Extensions ---------
# Uncomment (and create rtd.conf) to specify routing table for this peer.
#LoadExtension = "rt_default.fdx" : "rtd.conf";
# Uncomment (and create acl.conf) to allow incoming connections from other peers.
#LoadExtension = "acl_wl.fdx" : "/usr/local/src/trunk_co/openair-cn/OPENAIRHSS/conf/acl.conf";
# Uncomment to display periodic state information
#LoadExtension = "dbg_monitor.fdx";
# Uncomment to enable an interactive Python interpreter session.
# (see doc/dbg_interactive.py.sample for more information)
#LoadExtension = "dbg_interactive.fdx";
# Load the RFC4005 dictionary objects
#LoadExtension = "dict_nasreq.fdx";
LoadExtension = "dict_nas_mipv6.fdx";
LoadExtension = "dict_s6a.fdx";
# Load RFC4072 dictionary objects
#LoadExtension = "dict_eap.fdx";
# Load the Diameter EAP server extension (requires diameap.conf)
#LoadExtension = "app_diameap.fdx" : "diameap.conf";
# Load the Accounting Server extension (requires app_acct.conf)
#LoadExtension = "app_acct.fdx" : "app_acct.conf";
# -------- Peers ---------
# The framework will actively attempt to establish and maintain a connection
# with the peers listed here.
# For only accepting incoming connections, see the acl_wl.fx extension.
#ConnectPeer = "ubuntu.localdomain" { ConnectTo = "127.0.0.1"; No_TLS; };
#ConnectPeer = "roux.test.fr" { No_TLS; };
...@@ -65,7 +65,7 @@ int fd_g_debug_lvl = 1; ...@@ -65,7 +65,7 @@ int fd_g_debug_lvl = 1;
/* YACC forward declarations */ /* YACC forward declarations */
extern int yyparse (struct hss_config_s *hss_config_p); extern int yyparse (struct hss_config_s *hss_config_p);
extern uint8_t OP[16]; extern uint8_t opc[16];
static int config_parse_command_line(int argc, char *argv[], static int config_parse_command_line(int argc, char *argv[],
hss_config_t *hss_config_p); hss_config_t *hss_config_p);
static int config_parse_file(hss_config_t *hss_config_p); static int config_parse_file(hss_config_t *hss_config_p);
...@@ -107,14 +107,14 @@ int config_init(int argc, char *argv[], hss_config_t *hss_config_p) ...@@ -107,14 +107,14 @@ int config_init(int argc, char *argv[], hss_config_t *hss_config_p)
if (strlen(hss_config_p->operator_key) == 32) { if (strlen(hss_config_p->operator_key) == 32) {
ret = sscanf(hss_config_p->operator_key, ret = sscanf(hss_config_p->operator_key,
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
(unsigned int*)&OP[0],(unsigned int*)&OP[1], (unsigned int*)&opc[0],(unsigned int*)&opc[1],
(unsigned int*)&OP[2],(unsigned int*)&OP[3], (unsigned int*)&opc[2],(unsigned int*)&opc[3],
(unsigned int*)&OP[4],(unsigned int*)&OP[5], (unsigned int*)&opc[4],(unsigned int*)&opc[5],
(unsigned int*)&OP[6],(unsigned int*)&OP[7], (unsigned int*)&opc[6],(unsigned int*)&opc[7],
(unsigned int*)&OP[8],(unsigned int*)&OP[9], (unsigned int*)&opc[8],(unsigned int*)&opc[9],
(unsigned int*)&OP[10],(unsigned int*)&OP[11], (unsigned int*)&opc[10],(unsigned int*)&opc[11],
(unsigned int*)&OP[12],(unsigned int*)&OP[13], (unsigned int*)&opc[12],(unsigned int*)&opc[13],
(unsigned int*)&OP[14],(unsigned int*)&OP[15]); (unsigned int*)&opc[14],(unsigned int*)&opc[15]);
if (ret != 16) { if (ret != 16) {
fprintf(stderr, fprintf(stderr,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment