Commit fb902d98 authored by Florian Kaltenberger's avatar Florian Kaltenberger

Merge branch 'develop' into bugfix-40-channel_bandwidth

parents bc1f00e9 94a42bec
......@@ -1649,7 +1649,7 @@ foreach(myExe s1ap
${OPENAIR3_DIR}/TEST/test_${myExe}.c
)
target_link_libraries (test_${myExe}
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} fdproto fdcore
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
)
endforeach(myExe)
......
......@@ -47,6 +47,7 @@ PRINT_STATS="False"
VCD_TIMING="False"
REL="Rel10"
HW="EXMIMO"
NOS1=0
EPC=0
VERBOSE_COMPILE=0
CFLAGS_PROCESSOR_USER=""
......@@ -270,7 +271,6 @@ function main() {
echo_info "installing packages for BALDERF support"
check_install_bladerf_driver
fi
fi
if [ "$INSTALL_OPTIONAL" = "1" ] ; then
......@@ -321,7 +321,7 @@ function main() {
cmake ..
fi
if [ "$eNB" = "1" ] ; then
if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
echo_info "Compiling $lte_exec"
compilations \
$lte_build_dir $lte_exec \
......@@ -338,7 +338,7 @@ function main() {
fi
fi
if [ "$UE" = 1 ] ; then
if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then
# ue_ip driver compilation
echo_info "Compiling UE specific part"
compilations \
......
......@@ -662,16 +662,17 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
if (frame_parms->mode1_flag==0)
len = (nb_rb*8);// - (2*pbch_pss_sss_adjust/3);
len = (nb_rb*8)- (2*pbch_pss_sss_adjust/3);
else
len = (nb_rb*10);// - (5*pbch_pss_sss_adjust/6);
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
} else {
len = (nb_rb*12);// - pbch_pss_sss_adjust;
len = (nb_rb*12) - pbch_pss_sss_adjust;
}
// printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
// printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
for (i=0; i<len; i++) {
*llr32 = *rxF;
// printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]);
rxF++;
llr32++;
}
......
......@@ -42,9 +42,9 @@ static
void do_kdf(uint8_t *key, unsigned key_length, uint8_t *data, unsigned data_length,
uint8_t *exp, unsigned exp_length)
{
uint8_t *result;
uint8_t result[32];
kdf(key, key_length, data, data_length, &result, 32);
kdf(key, key_length, data, data_length, result, 32);
if (compare_buffer(result, exp_length, exp, exp_length) != 0) {
fail("Fail: kdf\n");
......
......@@ -39,15 +39,15 @@ static
void do_derive_kenb(uint32_t nas_count, const uint8_t *kasme, const unsigned length,
const uint8_t *kenb_exp)
{
uint8_t *kenb;
uint8_t kenb[32];
derive_keNB(kasme, nas_count, &kenb);
memset(kenb, 0, sizeof(kenb));
derive_keNB(kasme, nas_count, kenb);
if (compare_buffer(kenb_exp, length, kenb, length) != 0) {
fail("Fail: kenb derivation\n");
}
free(kenb);
}
void doit (void)
......
......@@ -39,21 +39,23 @@ static
void derive_knas_keys(algorithm_type_dist_t atd, uint8_t *kasme, unsigned length,
uint8_t *knas_enc_exp, uint8_t *knas_int_exp)
{
uint8_t *knas_enc;
uint8_t *knas_int;
uint8_t *knas_enc = NULL;
uint8_t *knas_int = NULL;
derive_key_nas_enc(atd, kasme, &knas_enc);
derive_key_nas_int(atd, kasme, &knas_int);
knas_enc = calloc(1, 32);
knas_int = calloc(1, 32);
derive_key_nas_enc(atd, kasme, knas_enc);
derive_key_nas_int(atd, kasme, knas_int);
/* Compare both keys with expected */
if (compare_buffer(knas_enc, 32, knas_enc_exp, 32) != 0) {
if (compare_buffer(knas_enc, 16, &knas_enc_exp[16], 16) != 0) {
fail("Fail: knas_enc derivation\n");
}
if (compare_buffer(knas_int, 32, knas_int_exp, 32) != 0) {
if (compare_buffer(knas_int, 16, &knas_int_exp[16], 16) != 0) {
fail("Fail: knas_int derivation\n");
}
free(knas_enc);
free(knas_int);
}
......
......@@ -40,14 +40,15 @@ void eea1_encrypt(uint8_t direction, uint32_t count,
uint8_t bearer, uint8_t *key, uint32_t key_length, uint8_t *message,
uint32_t length, uint8_t *expected)
{
nas_stream_cipher_t *nas_cipher;
uint8_t *result;
nas_stream_cipher_t *nas_cipher = NULL;
uint8_t *result = NULL;
uint32_t zero_bits = length & 7;
uint32_t byte_length = length >> 3;
if (zero_bits > 0)
byte_length += 1;
result = calloc(1, byte_length);
nas_cipher = calloc(1, sizeof(nas_stream_cipher_t));
nas_cipher->direction = direction;
......@@ -58,7 +59,7 @@ void eea1_encrypt(uint8_t direction, uint32_t count,
nas_cipher->blength = length;
nas_cipher->message = message;
if (nas_stream_encrypt_eea1(nas_cipher, &result) != 0)
if (nas_stream_encrypt_eea1(nas_cipher, result) != 0)
fail("Fail: nas_stream_encrypt_eea1\n");
if (compare_buffer(result, byte_length, expected, byte_length) != 0) {
......
......@@ -40,14 +40,15 @@ void eea2_encrypt(uint8_t direction, uint32_t count,
uint8_t bearer, uint8_t *key, uint32_t key_length, uint8_t *message,
uint32_t length, uint8_t *expected)
{
nas_stream_cipher_t *nas_cipher;
uint8_t *result;
nas_stream_cipher_t *nas_cipher = NULL;
uint8_t *result = NULL;
uint32_t zero_bits = length & 7;
uint32_t byte_length = length >> 3;
if (zero_bits > 0)
byte_length += 1;
result = calloc(1, byte_length);
nas_cipher = calloc(1, sizeof(nas_stream_cipher_t));
nas_cipher->direction = direction;
......@@ -58,7 +59,7 @@ void eea2_encrypt(uint8_t direction, uint32_t count,
nas_cipher->blength = length;
nas_cipher->message = message;
if (nas_stream_encrypt_eea2(nas_cipher, &result) != 0)
if (nas_stream_encrypt_eea2(nas_cipher, result) != 0)
fail("Fail: nas_stream_encrypt_eea2\n");
if (compare_buffer(result, byte_length, expected, byte_length) != 0) {
......
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