Packing and sending Authentication Reject if XRES != RES

This commit is contained in:
Pedro Alvarez 2017-11-13 12:35:53 +00:00
parent f908439ed4
commit d0c0d29f62
2 changed files with 17 additions and 15 deletions

View File

@ -420,7 +420,7 @@ s1ap::handle_uplink_nas_transport(LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT
break; break;
default: default:
m_s1ap_log->info("Unhandled NAS message"); 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"); m_s1ap_log->error("Failed to send NAS Attach Request");
return false; return false;
} }
m_s1ap_log->info("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 Security Mode Command\n"); m_s1ap_log->console("DL NAS: Sent Downlink NAs Message\n");
m_pool->deallocate(nas_msg); m_pool->deallocate(nas_msg);
m_pool->deallocate(reply_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->console("UE Authentication Rejected. IMSI: %lu\n", ue_ctx->imsi);
m_s1ap_log->warning("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); m_s1ap_nas_transport.pack_authentication_reject(reply_msg, ue_ctx->enb_ue_s1ap_id, ue_ctx->mme_ue_s1ap_id);
return false; return false;
} }
m_s1ap_log->console("UE Authentication Accepted. IMSI: %lu\n", ue_ctx->imsi); else
m_s1ap_log->info("UE Authentication Accepted. IMSI: %lu\n", ue_ctx->imsi); {
m_s1ap_log->console("UE Authentication Accepted. IMSI: %lu\n", ue_ctx->imsi);
//Send Security Mode Command m_s1ap_log->info("UE Authentication Accepted. IMSI: %lu\n", ue_ctx->imsi);
m_s1ap_nas_transport.pack_security_mode_command(reply_msg, ue_ctx); //Send Security Mode Command
m_s1ap_nas_transport.pack_security_mode_command(reply_msg, ue_ctx);
}
return true; return true;
} }

View File

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