Packing and sending Authentication Reject if XRES != RES

master
Pedro Alvarez 7 years ago
parent f908439ed4
commit d0c0d29f62

@ -420,7 +420,7 @@ s1ap::handle_uplink_nas_transport(LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT
break;
default:
m_s1ap_log->info("Unhandled NAS message");
return false; //FIXME cleanup (deallocate needs to be called)
return false; //FIXME (nas_msg deallocate needs to be called)
}
@ -431,8 +431,8 @@ s1ap::handle_uplink_nas_transport(LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT
m_s1ap_log->error("Failed to send NAS Attach Request");
return false;
}
m_s1ap_log->info("DL NAS: Sent Security Mode Command\n");
m_s1ap_log->console("DL NAS: Sent Security Mode Command\n");
m_s1ap_log->info("DL NAS: Sent Downlink NAS message\n");
m_s1ap_log->console("DL NAS: Sent Downlink NAs Message\n");
m_pool->deallocate(nas_msg);
m_pool->deallocate(reply_msg);
@ -472,15 +472,17 @@ s1ap::handle_nas_authentication_response(srslte::byte_buffer_t *nas_msg, srslte:
m_s1ap_log->console("UE Authentication Rejected. IMSI: %lu\n", ue_ctx->imsi);
m_s1ap_log->warning("UE Authentication Rejected. IMSI: %lu\n", ue_ctx->imsi);
//TODO send back error reply
//Send back Athentication Reject
m_s1ap_nas_transport.pack_authentication_reject(reply_msg, ue_ctx->enb_ue_s1ap_id, ue_ctx->mme_ue_s1ap_id);
return false;
}
m_s1ap_log->console("UE Authentication Accepted. IMSI: %lu\n", ue_ctx->imsi);
m_s1ap_log->info("UE Authentication Accepted. IMSI: %lu\n", ue_ctx->imsi);
//Send Security Mode Command
m_s1ap_nas_transport.pack_security_mode_command(reply_msg, ue_ctx);
else
{
m_s1ap_log->console("UE Authentication Accepted. IMSI: %lu\n", ue_ctx->imsi);
m_s1ap_log->info("UE Authentication Accepted. IMSI: %lu\n", ue_ctx->imsi);
//Send Security Mode Command
m_s1ap_nas_transport.pack_security_mode_command(reply_msg, ue_ctx);
}
return true;
}

@ -180,12 +180,12 @@ s1ap_nas_transport::pack_authentication_reject(srslte::byte_buffer_t *reply_msg,
dw_nas->HandoverRestrictionList_present=false;
dw_nas->SubscriberProfileIDforRFP_present=false;
LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT auth_rej;
LIBLTE_ERROR_ENUM err = liblte_mme_pack_authentication_request_msg(&auth_rej, (LIBLTE_BYTE_MSG_STRUCT *) nas_buffer);
LIBLTE_MME_AUTHENTICATION_REJECT_MSG_STRUCT auth_rej;
LIBLTE_ERROR_ENUM err = liblte_mme_pack_authentication_reject_msg(&auth_rej, (LIBLTE_BYTE_MSG_STRUCT *) nas_buffer);
if(err != LIBLTE_SUCCESS)
{
m_s1ap_log->error("Error packing Athentication Request\n");
m_s1ap_log->console("Error packing Athentication Request\n");
m_s1ap_log->error("Error packing Athentication Reject\n");
m_s1ap_log->console("Error packing Athentication Reject\n");
return false;
}
@ -197,8 +197,8 @@ s1ap_nas_transport::pack_authentication_reject(srslte::byte_buffer_t *reply_msg,
err = liblte_s1ap_pack_s1ap_pdu(&tx_pdu, (LIBLTE_BYTE_MSG_STRUCT *) reply_msg);
if(err != LIBLTE_SUCCESS)
{
m_s1ap_log->error("Error packing Athentication Reject\n");
m_s1ap_log->console("Error packing Athentication Reject\n");
m_s1ap_log->error("Error packing Dw NAS Transport: Athentication Reject\n");
m_s1ap_log->console("Error packing Downlink NAS Transport: Athentication Reject\n");
return false;
}

Loading…
Cancel
Save