Commit 45d55b16 authored by Lionel Gauthier's avatar Lionel Gauthier

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5512 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 0f2eae24
...@@ -6,7 +6,6 @@ ...@@ -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, ...@@ -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 ...@@ -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
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