git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5512 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -6,7 +6,6 @@
|
|||||||
#include "security_types.h"
|
#include "security_types.h"
|
||||||
#include "secu_defs.h"
|
#include "secu_defs.h"
|
||||||
|
|
||||||
inline
|
|
||||||
void kdf(const uint8_t *s, const uint32_t s_length, const uint8_t *key,
|
void kdf(const uint8_t *s, const uint32_t s_length, const uint8_t *key,
|
||||||
const uint32_t key_length, uint8_t **out, uint32_t out_length)
|
const uint32_t key_length, uint8_t **out, uint32_t out_length)
|
||||||
{
|
{
|
||||||
@@ -22,20 +21,20 @@ void kdf(const uint8_t *s, const uint32_t s_length, const uint8_t *key,
|
|||||||
|
|
||||||
*out = buffer;
|
*out = buffer;
|
||||||
}
|
}
|
||||||
|
#ifndef NAS_UE
|
||||||
int derive_keNB(const uint8_t kasme[32], const uint32_t nas_count, uint8_t **keNB)
|
int derive_keNB(const uint8_t kasme[32], const uint32_t nas_count, uint8_t **keNB)
|
||||||
{
|
{
|
||||||
uint8_t string[7];
|
uint8_t string[7];
|
||||||
|
|
||||||
/* FC */
|
// FC
|
||||||
string[0] = FC_KENB;
|
string[0] = FC_KENB;
|
||||||
/* P0 = Uplink NAS count */
|
// P0 = Uplink NAS count
|
||||||
string[1] = (nas_count & 0xff000000) >> 24;
|
string[1] = (nas_count & 0xff000000) >> 24;
|
||||||
string[2] = (nas_count & 0x00ff0000) >> 16;
|
string[2] = (nas_count & 0x00ff0000) >> 16;
|
||||||
string[3] = (nas_count & 0x0000ff00) >> 8;
|
string[3] = (nas_count & 0x0000ff00) >> 8;
|
||||||
string[4] = (nas_count & 0x000000ff);
|
string[4] = (nas_count & 0x000000ff);
|
||||||
|
|
||||||
/* Length of NAS count */
|
// Length of NAS count
|
||||||
string[5] = 0x00;
|
string[5] = 0x00;
|
||||||
string[6] = 0x04;
|
string[6] = 0x04;
|
||||||
|
|
||||||
@@ -43,3 +42,5 @@ int derive_keNB(const uint8_t kasme[32], const uint32_t nas_count, uint8_t **keN
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user