From 3ec3d2a6b13d044722b61fa20e10c8a64617d2aa Mon Sep 17 00:00:00 2001 From: calvin wang <calvin.wang@tcl.com> Date: Wed, 11 Jan 2017 14:56:56 +0800 Subject: [PATCH] fix mistake logical and bitwise operators --- openair3/NAS/COMMON/API/NETWORK/nas_message.c | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/openair3/NAS/COMMON/API/NETWORK/nas_message.c b/openair3/NAS/COMMON/API/NETWORK/nas_message.c index 8f326904ef..f714af66f7 100644 --- a/openair3/NAS/COMMON/API/NETWORK/nas_message.c +++ b/openair3/NAS/COMMON/API/NETWORK/nas_message.c @@ -992,12 +992,12 @@ static int _nas_message_decrypt( case NAS_SECURITY_ALGORITHMS_EEA1: { if (direction == SECU_DIRECTION_UPLINK) { - count = 0x00000000 || - ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) || + count = 0x00000000 | + ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) | (emm_security_context->ul_count.seq_num & 0x000000FF); } else { - count = 0x00000000 || - ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) || + count = 0x00000000 | + ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) | (emm_security_context->dl_count.seq_num & 0x000000FF); } @@ -1026,12 +1026,12 @@ static int _nas_message_decrypt( case NAS_SECURITY_ALGORITHMS_EEA2: { if (direction == SECU_DIRECTION_UPLINK) { - count = 0x00000000 || - ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) || + count = 0x00000000 | + ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) | (emm_security_context->ul_count.seq_num & 0x000000FF); } else { - count = 0x00000000 || - ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) || + count = 0x00000000 | + ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) | (emm_security_context->dl_count.seq_num & 0x000000FF); } @@ -1154,12 +1154,12 @@ static int _nas_message_encrypt( case NAS_SECURITY_ALGORITHMS_EEA1: { if (direction == SECU_DIRECTION_UPLINK) { - count = 0x00000000 || - ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) || + count = 0x00000000 | + ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) | (emm_security_context->ul_count.seq_num & 0x000000FF); } else { - count = 0x00000000 || - ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) || + count = 0x00000000 | + ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) | (emm_security_context->dl_count.seq_num & 0x000000FF); } @@ -1185,12 +1185,12 @@ static int _nas_message_encrypt( case NAS_SECURITY_ALGORITHMS_EEA2: { if (direction == SECU_DIRECTION_UPLINK) { - count = 0x00000000 || - ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) || + count = 0x00000000 | + ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) | (emm_security_context->ul_count.seq_num & 0x000000FF); } else { - count = 0x00000000 || - ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) || + count = 0x00000000 | + ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) | (emm_security_context->dl_count.seq_num & 0x000000FF); } @@ -1299,12 +1299,12 @@ static uint32_t _nas_message_get_mac( int i,bytes = 0; if (direction == SECU_DIRECTION_UPLINK) { - count = 0x00000000 || - ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) || + count = 0x00000000 | + ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) | (emm_security_context->ul_count.seq_num & 0x000000FF); } else { - count = 0x00000000 || - ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) || + count = 0x00000000 | + ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) | (emm_security_context->dl_count.seq_num & 0x000000FF); } @@ -1367,12 +1367,12 @@ static uint32_t _nas_message_get_mac( uint32_t *mac32; if (direction == SECU_DIRECTION_UPLINK) { - count = 0x00000000 || - ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) || + count = 0x00000000 | + ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) | (emm_security_context->ul_count.seq_num & 0x000000FF); } else { - count = 0x00000000 || - ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) || + count = 0x00000000 | + ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) | (emm_security_context->dl_count.seq_num & 0x000000FF); } -- GitLab