Commit 1449fc56 authored by yangjian's avatar yangjian

Fixed a crash when AMF authentication failed

parent 6cd3f6be
...@@ -1476,8 +1476,12 @@ bool amf_n1::_5g_aka_confirmation_from_ausf(std::shared_ptr<nas_context> &nc, ...@@ -1476,8 +1476,12 @@ bool amf_n1::_5g_aka_confirmation_from_ausf(std::shared_ptr<nas_context> &nc,
try { try {
ConfirmationDataResponse confirmationdataresponse; ConfirmationDataResponse confirmationdataresponse;
nlohmann::json::parse(Response.c_str()).get_to(confirmationdataresponse); nlohmann::json::parse(Response.c_str()).get_to(confirmationdataresponse);
unsigned char *kseaf_hex = unsigned char *kseaf_hex = NULL;
format_string_as_hex(confirmationdataresponse.getKseaf()); if(confirmationdataresponse.getAuthResult())
kseaf_hex = format_string_as_hex(confirmationdataresponse.getKseaf());
else
return false;
memcpy(nc.get()->_5g_av[0].kseaf, kseaf_hex, 32); memcpy(nc.get()->_5g_av[0].kseaf, kseaf_hex, 32);
print_buffer("amf_n1", "5G AV: kseaf", nc.get()->_5g_av[0].kseaf, 32); print_buffer("amf_n1", "5G AV: kseaf", nc.get()->_5g_av[0].kseaf, 32);
free_wrapper((void **)&kseaf_hex); free_wrapper((void **)&kseaf_hex);
......
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