Commit 4b0650cf authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Tentative fix for NIA0 issue

parent 47da9a26
......@@ -347,8 +347,10 @@ void amf_n1::handle_itti_message(itti_uplink_nas_data_ind& nas_data_ind) {
(uint8_t*) bdata(recved_nas_msg) + 6, blength(recved_nas_msg) - 6,
mac32)) {
// IA0_5G
decoded_plain_msg = blk2bstr(
(uint8_t*) bdata(recved_nas_msg) + 7, blength(recved_nas_msg) - 7);
// decoded_plain_msg = blk2bstr(
// (uint8_t*) bdata(recved_nas_msg) + 7, blength(recved_nas_msg) -
// 7);
} else {
bool isMatched = false;
uint8_t* buf = (uint8_t*) bdata(recved_nas_msg);
......@@ -364,7 +366,8 @@ void amf_n1::handle_itti_message(itti_uplink_nas_data_ind& nas_data_ind) {
if (!isMatched) {
Logger::amf_n1().error("Received message not integrity matched");
return;
} else {
}
/*else {
bstring ciphered = blk2bstr(buf + 7, buf_len - 7);
if (!nas_message_cipher_protected(
nc.get()->security_ctx, NAS_MESSAGE_UPLINK, ciphered,
......@@ -373,6 +376,7 @@ void amf_n1::handle_itti_message(itti_uplink_nas_data_ind& nas_data_ind) {
return;
}
}
*/
}
} break;
default: {
......@@ -381,6 +385,18 @@ void amf_n1::handle_itti_message(itti_uplink_nas_data_ind& nas_data_ind) {
}
}
// decoded_plain_msg = blk2bstr(
// (uint8_t*) bdata(recved_nas_msg) + 7, blength(recved_nas_msg) - 7);
bstring ciphered = blk2bstr(
(uint8_t*) bdata(recved_nas_msg) + 7, blength(recved_nas_msg) - 7);
if (!nas_message_cipher_protected(
nc.get()->security_ctx, NAS_MESSAGE_UPLINK, ciphered,
decoded_plain_msg)) {
Logger::amf_n1().error("Decrypt NAS message failure");
return;
}
if (nas_data_ind.is_nas_signalling_estab_req) {
Logger::amf_n1().debug("Received NAS signalling establishment request...");
print_buffer(
......
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