|
|
@ -388,14 +388,17 @@ void nas::write_pdu(uint32_t lcid, byte_buffer_t *pdu) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t nas::get_ul_count() {
|
|
|
|
void nas::set_k_enb_count() {
|
|
|
|
// UL count for RRC key derivation depends on ESM information transfer procedure
|
|
|
|
// UL count for RRC key derivation depends on UL count of the Authentication Request or Service Request.
|
|
|
|
if (cfg.apn.empty()) {
|
|
|
|
// This function should be called after sending these messages, for later derivation of the keys.
|
|
|
|
// No ESM info transfer has been sent
|
|
|
|
ctxt.k_enb_count = ctxt.tx_count;
|
|
|
|
return ctxt.tx_count - 1;
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return ctxt.tx_count - 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t nas::get_k_enb_count() {
|
|
|
|
|
|
|
|
// UL count for RRC key derivation depends on UL count of the Authentication Request or Service Request.
|
|
|
|
|
|
|
|
// On the special case of Service Request without authentication, the UL count for the SR must be used.
|
|
|
|
|
|
|
|
return ctxt.k_enb_count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool nas::get_k_asme(uint8_t *k_asme_, uint32_t n) {
|
|
|
|
bool nas::get_k_asme(uint8_t *k_asme_, uint32_t n) {
|
|
|
@ -886,6 +889,7 @@ void nas::parse_authentication_request(uint32_t lcid, byte_buffer_t *pdu, const
|
|
|
|
nas_log->info("Network authentication successful\n");
|
|
|
|
nas_log->info("Network authentication successful\n");
|
|
|
|
send_authentication_response(res, res_len, sec_hdr_type);
|
|
|
|
send_authentication_response(res, res_len, sec_hdr_type);
|
|
|
|
nas_log->info_hex(ctxt.k_asme, 32, "Generated k_asme:\n");
|
|
|
|
nas_log->info_hex(ctxt.k_asme, 32, "Generated k_asme:\n");
|
|
|
|
|
|
|
|
set_k_enb_count();
|
|
|
|
auth_request = true;
|
|
|
|
auth_request = true;
|
|
|
|
} else if (auth_result == AUTH_SYNCH_FAILURE) {
|
|
|
|
} else if (auth_result == AUTH_SYNCH_FAILURE) {
|
|
|
|
nas_log->error("Network authentication synchronization failure.\n");
|
|
|
|
nas_log->error("Network authentication synchronization failure.\n");
|
|
|
@ -1214,6 +1218,7 @@ void nas::gen_service_request(byte_buffer_t *msg) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ctxt.tx_count++;
|
|
|
|
ctxt.tx_count++;
|
|
|
|
|
|
|
|
set_k_enb_count();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void nas::gen_pdn_connectivity_request(LIBLTE_BYTE_MSG_STRUCT *msg) {
|
|
|
|
void nas::gen_pdn_connectivity_request(LIBLTE_BYTE_MSG_STRUCT *msg) {
|
|
|
|