|
|
|
@ -121,6 +121,7 @@ SRSASN_CODE mobile_identity_5gs_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
SRSASN_CODE mobile_identity_5gs_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
// Length
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
uint8_t tmp;
|
|
|
|
|
HANDLE_CODE(bref.unpack(tmp, 5));
|
|
|
|
@ -447,6 +448,7 @@ SRSASN_CODE capability_5gmm_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.1
|
|
|
|
|
SRSASN_CODE capability_5gmm_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 1 || length > 13) {
|
|
|
|
|
asn1::log_error("Decoding Failed (5GMM capability): Length (%d) is not in range of min: 1 and max 13 bytes",
|
|
|
|
@ -548,6 +550,7 @@ SRSASN_CODE ue_security_capability_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.54
|
|
|
|
|
SRSASN_CODE ue_security_capability_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 2 || length > 8) {
|
|
|
|
|
asn1::log_error("Decoding Failed (UE security capability): Length (%d) is not in range of min: 2 and max 8 bytes",
|
|
|
|
@ -622,6 +625,7 @@ SRSASN_CODE nssai_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.37
|
|
|
|
|
SRSASN_CODE nssai_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 2 || length > 144) {
|
|
|
|
|
asn1::log_error("Decoding Failed (NSSAI): Length (%d) is not in range of min: 2 and max 144 bytes", length);
|
|
|
|
@ -749,6 +753,7 @@ SRSASN_CODE s1_ue_network_capability_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.48
|
|
|
|
|
SRSASN_CODE s1_ue_network_capability_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 2 || length > 13) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
@ -893,6 +898,7 @@ SRSASN_CODE uplink_data_status_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.57
|
|
|
|
|
SRSASN_CODE uplink_data_status_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 2 || length > 32) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Uplink data status): Length (%d) is not in range of min: 2 and max 32 bytes",
|
|
|
|
@ -963,6 +969,7 @@ SRSASN_CODE pdu_session_status_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.44
|
|
|
|
|
SRSASN_CODE pdu_session_status_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 2 || length > 32) {
|
|
|
|
|
asn1::log_error("Decoding Failed (PDU session status): Length (%d) is not in range of min: 2 and max 32 bytes",
|
|
|
|
@ -1042,6 +1049,7 @@ SRSASN_CODE ue_status_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.56
|
|
|
|
|
SRSASN_CODE ue_status_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (UE status): Length (%d) does not equal expected length 1", length);
|
|
|
|
@ -1096,6 +1104,7 @@ SRSASN_CODE allowed_pdu_session_status_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.13
|
|
|
|
|
SRSASN_CODE allowed_pdu_session_status_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 2 || length > 32) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
@ -1152,6 +1161,7 @@ SRSASN_CODE ue_usage_setting_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.55
|
|
|
|
|
SRSASN_CODE ue_usage_setting_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (UE usage setting): Length (%d) does not equal expected length 1", length);
|
|
|
|
@ -1191,6 +1201,7 @@ SRSASN_CODE drx_parameters_5gs_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.2A
|
|
|
|
|
SRSASN_CODE drx_parameters_5gs_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (5GS DRX parameters): Length (%d) does not equal expected length 1", length);
|
|
|
|
@ -1222,6 +1233,7 @@ SRSASN_CODE eps_nas_message_container_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.24
|
|
|
|
|
SRSASN_CODE eps_nas_message_container_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
eps_nas_message_container.resize(length);
|
|
|
|
|
HANDLE_CODE(bref.unpack_bytes(eps_nas_message_container.data(), length));
|
|
|
|
@ -1243,7 +1255,7 @@ SRSASN_CODE ladn_indication_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
bref.align_bytes_zero();
|
|
|
|
|
uint16_t length = (uint16_t)(ceilf((float)bref.distance(bref_length) / 8) - 2);
|
|
|
|
|
|
|
|
|
|
// MIN 0 not check because auf uint underflow
|
|
|
|
|
// min. length of 0 not checked: uint underflow
|
|
|
|
|
if (length > 808) {
|
|
|
|
|
asn1::log_error("Encoding Failed (LADN indication): Packed length (%d) is not in range of max 808 bytes", length);
|
|
|
|
|
return asn1::SRSASN_ERROR_ENCODE_FAIL;
|
|
|
|
@ -1256,8 +1268,9 @@ SRSASN_CODE ladn_indication_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.29
|
|
|
|
|
SRSASN_CODE ladn_indication_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
// MIN 0 not check because auf uint underflow
|
|
|
|
|
// min. length of 0 not checked: uint underflow
|
|
|
|
|
if (length > 808) {
|
|
|
|
|
asn1::log_error("Decoding Failed (LADN indication): Length (%d) is not in range of max 808 bytes", length);
|
|
|
|
|
return asn1::SRSASN_ERROR_DECODE_FAIL;
|
|
|
|
@ -1299,7 +1312,7 @@ SRSASN_CODE payload_container_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
bref.align_bytes_zero();
|
|
|
|
|
uint16_t length = (uint16_t)(ceilf((float)bref.distance(bref_length) / 8) - 2);
|
|
|
|
|
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 1) {
|
|
|
|
|
asn1::log_error("Encoding Failed (Payload container): Packed length (%d) is not in range of min: 1 bytes", length);
|
|
|
|
|
return asn1::SRSASN_ERROR_ENCODE_FAIL;
|
|
|
|
@ -1312,8 +1325,9 @@ SRSASN_CODE payload_container_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.39
|
|
|
|
|
SRSASN_CODE payload_container_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Payload container): Length (%d) is not in range of min: 1 bytes", length);
|
|
|
|
|
return asn1::SRSASN_ERROR_DECODE_FAIL;
|
|
|
|
@ -1371,6 +1385,7 @@ SRSASN_CODE update_type_5gs_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.9A
|
|
|
|
|
SRSASN_CODE update_type_5gs_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8)); // 2 Spare bits
|
|
|
|
|
bref.advance_bits(2);
|
|
|
|
|
HANDLE_CODE(pnb_eps_c_io_t.unpack(bref));
|
|
|
|
@ -1406,6 +1421,7 @@ SRSASN_CODE mobile_station_classmark_2_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.31C
|
|
|
|
|
SRSASN_CODE mobile_station_classmark_2_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 3) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Mobile station classmark 2): Length (%d) does not equal expected length 3",
|
|
|
|
@ -1444,6 +1460,7 @@ SRSASN_CODE supported_codec_list_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.51A
|
|
|
|
|
SRSASN_CODE supported_codec_list_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 3) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Supported codec list): Length (%d) is not in range of min: 3 bytes", length);
|
|
|
|
@ -1481,6 +1498,7 @@ SRSASN_CODE message_container_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.33
|
|
|
|
|
SRSASN_CODE message_container_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
if (length < 1 || length > 65532) {
|
|
|
|
|
asn1::log_error("Decoding Failed (message container): Length (%d) is not in range of min: 1 and max 65532 bytes",
|
|
|
|
@ -1533,6 +1551,7 @@ SRSASN_CODE eps_bearer_context_status_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.23A
|
|
|
|
|
SRSASN_CODE eps_bearer_context_status_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 2) {
|
|
|
|
|
asn1::log_error("Decoding Failed (EPS bearer context status): Length (%d) does not equal expected length 2",
|
|
|
|
@ -1585,6 +1604,7 @@ SRSASN_CODE extended_drx_parameters_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.26A
|
|
|
|
|
SRSASN_CODE extended_drx_parameters_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Extended DRX parameters): Length (%d) does not equal expected length 1", length);
|
|
|
|
@ -1621,6 +1641,7 @@ SRSASN_CODE gprs_timer_3_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.2.5
|
|
|
|
|
SRSASN_CODE gprs_timer_3_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (GPRS timer 3): Length (%d) does not equal expected length 1", length);
|
|
|
|
@ -1651,6 +1672,7 @@ SRSASN_CODE ue_radio_capability_id_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.68
|
|
|
|
|
SRSASN_CODE ue_radio_capability_id_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
ue_radio_capability_id.resize(length);
|
|
|
|
|
HANDLE_CODE(bref.unpack_bytes(ue_radio_capability_id.data(), length));
|
|
|
|
@ -1683,6 +1705,7 @@ SRSASN_CODE mapped_nssai_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.31B
|
|
|
|
|
SRSASN_CODE mapped_nssai_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 2 || length > 40) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Mapped NSSAI): Length (%d) is not in range of min: 2 and max 40 bytes", length);
|
|
|
|
@ -1717,6 +1740,7 @@ SRSASN_CODE additional_information_requested_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.12A
|
|
|
|
|
SRSASN_CODE additional_information_requested_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8)); // 7 Spare bits
|
|
|
|
|
bref.advance_bits(7);
|
|
|
|
|
HANDLE_CODE(bref.unpack(cipher_key, 1));
|
|
|
|
@ -1749,6 +1773,7 @@ SRSASN_CODE wus_assistance_information_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.71
|
|
|
|
|
SRSASN_CODE wus_assistance_information_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (WUS assistance information): Length (%d) is not in range of min: 1 bytes",
|
|
|
|
@ -1809,6 +1834,7 @@ SRSASN_CODE nb_n1_mode_drx_parameters_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.73
|
|
|
|
|
SRSASN_CODE nb_n1_mode_drx_parameters_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (NB-N1 mode DRX parameters): Length (%d) does not equal expected length 1",
|
|
|
|
@ -1852,6 +1878,7 @@ SRSASN_CODE registration_result_5gs_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.6
|
|
|
|
|
SRSASN_CODE registration_result_5gs_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (5GS registration result): Length (%d) does not equal expected length 1", length);
|
|
|
|
@ -1887,6 +1914,7 @@ SRSASN_CODE plmn_list_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.45
|
|
|
|
|
SRSASN_CODE plmn_list_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
// TODO proper unpacking
|
|
|
|
|
bref.advance_bits(length * 8);
|
|
|
|
@ -1920,6 +1948,7 @@ SRSASN_CODE tracking_area_identity_list_5gs_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.9
|
|
|
|
|
SRSASN_CODE tracking_area_identity_list_5gs_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 7) {
|
|
|
|
|
asn1::log_error("Decoding Failed (5GS tracking area identity list): Length (%d) does not equal expected length 7",
|
|
|
|
@ -1953,6 +1982,7 @@ SRSASN_CODE rejected_nssai_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.46
|
|
|
|
|
SRSASN_CODE rejected_nssai_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
// TODO proper unpacking
|
|
|
|
|
bref.advance_bits(length * 8);
|
|
|
|
@ -1986,6 +2016,7 @@ SRSASN_CODE network_feature_support_5gs_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.5
|
|
|
|
|
SRSASN_CODE network_feature_support_5gs_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 1 || length > 3) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
@ -2040,6 +2071,7 @@ SRSASN_CODE pdu_session_reactivation_result_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.42
|
|
|
|
|
SRSASN_CODE pdu_session_reactivation_result_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 2 || length > 32) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
@ -2099,6 +2131,7 @@ SRSASN_CODE pdu_session_reactivation_result_error_cause_t::pack(asn1::bit_ref& b
|
|
|
|
|
// Reference: 9.11.3.43
|
|
|
|
|
SRSASN_CODE pdu_session_reactivation_result_error_cause_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
if (length < 2 || length > 512) {
|
|
|
|
|
asn1::log_error("Decoding Failed (PDU session reactivation result error cause): Length (%d) is not in range of "
|
|
|
|
@ -2125,7 +2158,7 @@ SRSASN_CODE ladn_information_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
bref.align_bytes_zero();
|
|
|
|
|
uint16_t length = (uint16_t)(ceilf((float)bref.distance(bref_length) / 8) - 2);
|
|
|
|
|
|
|
|
|
|
// MIN 0 not check because auf uint underflow
|
|
|
|
|
// min. length of 0 not checked: uint underflow
|
|
|
|
|
if (length > 1712) {
|
|
|
|
|
asn1::log_error("Encoding Failed (LADN information): Packed length (%d) is not in range of max 1712 bytes", length);
|
|
|
|
|
return asn1::SRSASN_ERROR_ENCODE_FAIL;
|
|
|
|
@ -2138,8 +2171,9 @@ SRSASN_CODE ladn_information_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.30
|
|
|
|
|
SRSASN_CODE ladn_information_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
// MIN 0 not check because auf uint underflow
|
|
|
|
|
// min. length of 0 not checked: uint underflow
|
|
|
|
|
if (length > 1712) {
|
|
|
|
|
asn1::log_error("Decoding Failed (LADN information): Length (%d) is not in range of max 1712 bytes", length);
|
|
|
|
|
return asn1::SRSASN_ERROR_DECODE_FAIL;
|
|
|
|
@ -2171,6 +2205,7 @@ SRSASN_CODE service_area_list_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.49
|
|
|
|
|
SRSASN_CODE service_area_list_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
// TODO proper unpacking
|
|
|
|
|
bref.advance_bits(length * 8);
|
|
|
|
@ -2202,6 +2237,7 @@ SRSASN_CODE gprs_timer_2_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.2.4
|
|
|
|
|
SRSASN_CODE gprs_timer_2_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (GPRS timer 2): Length (%d) does not equal expected length 1", length);
|
|
|
|
@ -2238,6 +2274,7 @@ SRSASN_CODE emergency_number_list_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.23
|
|
|
|
|
SRSASN_CODE emergency_number_list_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 3 || length > 48) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Emergency number list): Length (%d) is not in range of min: 3 and max 48 bytes",
|
|
|
|
@ -2263,7 +2300,7 @@ SRSASN_CODE extended_emergency_number_list_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
bref.align_bytes_zero();
|
|
|
|
|
uint16_t length = (uint16_t)(ceilf((float)bref.distance(bref_length) / 8) - 2);
|
|
|
|
|
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 4) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
|
"Encoding Failed (Extended emergency number list): Packed length (%d) is not in range of min: 4 bytes", length);
|
|
|
|
@ -2277,8 +2314,9 @@ SRSASN_CODE extended_emergency_number_list_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.26
|
|
|
|
|
SRSASN_CODE extended_emergency_number_list_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 4) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Extended emergency number list): Length (%d) is not in range of min: 4 bytes",
|
|
|
|
|
length);
|
|
|
|
@ -2316,6 +2354,7 @@ SRSASN_CODE sor_transparent_container_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.51
|
|
|
|
|
SRSASN_CODE sor_transparent_container_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
if (length < 17) {
|
|
|
|
|
asn1::log_error("Decoding Failed (SOR transparent container): Length (%d) is not in range of min: 17 bytes",
|
|
|
|
@ -2353,6 +2392,7 @@ SRSASN_CODE eap_message_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.2.2
|
|
|
|
|
SRSASN_CODE eap_message_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
if (length < 4 || length > 1500) {
|
|
|
|
|
asn1::log_error("Decoding Failed (EAP message): Length (%d) is not in range of min: 4 and max 1500 bytes", length);
|
|
|
|
@ -2404,6 +2444,7 @@ SRSASN_CODE operator_defined_access_category_definitions_t::pack(asn1::bit_ref&
|
|
|
|
|
// Reference: 9.11.3.38
|
|
|
|
|
SRSASN_CODE operator_defined_access_category_definitions_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
// TODO proper unpacking
|
|
|
|
|
bref.advance_bits(length * 8);
|
|
|
|
@ -2477,6 +2518,7 @@ SRSASN_CODE ciphering_key_data_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.18C
|
|
|
|
|
SRSASN_CODE ciphering_key_data_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
if (length < 31 || length > 2672) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Ciphering key data): Length (%d) is not in range of min: 31 and max 2672 bytes",
|
|
|
|
@ -2510,6 +2552,7 @@ SRSASN_CODE cag_information_list_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.18A
|
|
|
|
|
SRSASN_CODE cag_information_list_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
// TODO proper unpacking
|
|
|
|
|
bref.advance_bits(length * 8);
|
|
|
|
@ -2544,6 +2587,7 @@ SRSASN_CODE truncated_5g_s_tmsi_configuration_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.70
|
|
|
|
|
SRSASN_CODE truncated_5g_s_tmsi_configuration_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Truncated 5G-S-TMSI configuration): Length (%d) does not equal expected length 1",
|
|
|
|
@ -2666,6 +2710,7 @@ SRSASN_CODE network_name_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.35
|
|
|
|
|
SRSASN_CODE network_name_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
// TODO proper unpacking
|
|
|
|
|
bref.advance_bits(length * 8);
|
|
|
|
@ -2740,6 +2785,7 @@ SRSASN_CODE daylight_saving_time_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.19
|
|
|
|
|
SRSASN_CODE daylight_saving_time_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Daylight saving time): Length (%d) does not equal expected length 1", length);
|
|
|
|
@ -2813,6 +2859,7 @@ SRSASN_CODE abba_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.10
|
|
|
|
|
SRSASN_CODE abba_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 2) {
|
|
|
|
|
asn1::log_error("Decoding Failed (ABBA): Length (%d) is not in range of min: 2 bytes", length);
|
|
|
|
@ -2865,6 +2912,7 @@ SRSASN_CODE authentication_parameter_autn_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.15
|
|
|
|
|
SRSASN_CODE authentication_parameter_autn_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 16) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Authentication parameter AUTN): Length (%d) does not equal expected length 16",
|
|
|
|
@ -2902,6 +2950,7 @@ SRSASN_CODE authentication_response_parameter_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.17
|
|
|
|
|
SRSASN_CODE authentication_response_parameter_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 16) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
@ -2939,6 +2988,7 @@ SRSASN_CODE authentication_failure_parameter_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.14
|
|
|
|
|
SRSASN_CODE authentication_failure_parameter_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 14) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Authentication failure parameter): Length (%d) does not equal expected length 14",
|
|
|
|
@ -3065,6 +3115,7 @@ SRSASN_CODE additional_5g_security_information_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.12
|
|
|
|
|
SRSASN_CODE additional_5g_security_information_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
@ -3148,6 +3199,7 @@ SRSASN_CODE s1_ue_security_capability_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.3.48A
|
|
|
|
|
SRSASN_CODE s1_ue_security_capability_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 2 || length > 5) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
@ -3277,15 +3329,15 @@ SRSASN_CODE s_nssai_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
asn1::bit_ref bref_length = bref;
|
|
|
|
|
HANDLE_CODE(bref.advance_bits(8));
|
|
|
|
|
|
|
|
|
|
if (length == s_nssai_t::SST_type_::options::sst) {
|
|
|
|
|
if (type == s_nssai_t::SST_type_::options::sst) {
|
|
|
|
|
HANDLE_CODE(bref.pack(sst, 8));
|
|
|
|
|
} else if (length == s_nssai_t::SST_type_::options::sst_and_mapped_hplmn_sst) {
|
|
|
|
|
} else if (type == s_nssai_t::SST_type_::options::sst_and_mapped_hplmn_sst) {
|
|
|
|
|
HANDLE_CODE(bref.pack(sst, 8));
|
|
|
|
|
HANDLE_CODE(bref.pack(mapped_hplmn_sst, 8));
|
|
|
|
|
} else if (length == s_nssai_t::SST_type_::options::sst_and_sd) {
|
|
|
|
|
} else if (type == s_nssai_t::SST_type_::options::sst_and_sd) {
|
|
|
|
|
HANDLE_CODE(bref.pack(sst, 8));
|
|
|
|
|
HANDLE_CODE(bref.pack(sd, 24));
|
|
|
|
|
} else if (length == s_nssai_t::SST_type_::options::sst_sd_mapped_hplmn_sst_and_mapped_hplmn_sd) {
|
|
|
|
|
} else if (type == s_nssai_t::SST_type_::options::sst_sd_mapped_hplmn_sst_and_mapped_hplmn_sd) {
|
|
|
|
|
HANDLE_CODE(bref.pack(sst, 8));
|
|
|
|
|
HANDLE_CODE(bref.pack(sd, 24));
|
|
|
|
|
HANDLE_CODE(bref.pack(mapped_hplmn_sst, 8));
|
|
|
|
@ -3310,26 +3362,31 @@ SRSASN_CODE s_nssai_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.2.8
|
|
|
|
|
SRSASN_CODE s_nssai_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 1 || length > 8) {
|
|
|
|
|
asn1::log_error("Decoding Failed (S-NSSAI): Length (%d) is not in range of min: 1 and max 8 bytes", length);
|
|
|
|
|
return asn1::SRSASN_ERROR_DECODE_FAIL;
|
|
|
|
|
}
|
|
|
|
|
if (length == s_nssai_t::SST_type_::options::sst) {
|
|
|
|
|
type = s_nssai_t::SST_type_::options::sst;
|
|
|
|
|
HANDLE_CODE(bref.unpack(sst, 8));
|
|
|
|
|
} else if (length == s_nssai_t::SST_type_::options::sst_and_mapped_hplmn_sst) {
|
|
|
|
|
type = s_nssai_t::SST_type_::options::sst_and_mapped_hplmn_sst;
|
|
|
|
|
HANDLE_CODE(bref.unpack(sst, 8));
|
|
|
|
|
HANDLE_CODE(bref.unpack(mapped_hplmn_sst, 8));
|
|
|
|
|
} else if (length == s_nssai_t::SST_type_::options::sst_and_sd) {
|
|
|
|
|
type = s_nssai_t::SST_type_::options::sst_and_sd;
|
|
|
|
|
HANDLE_CODE(bref.unpack(sst, 8));
|
|
|
|
|
HANDLE_CODE(bref.unpack(sd, 24));
|
|
|
|
|
} else if (length == s_nssai_t::SST_type_::options::sst_sd_mapped_hplmn_sst_and_mapped_hplmn_sd) {
|
|
|
|
|
type = s_nssai_t::SST_type_::options::sst_sd_mapped_hplmn_sst_and_mapped_hplmn_sd;
|
|
|
|
|
HANDLE_CODE(bref.unpack(sst, 8));
|
|
|
|
|
HANDLE_CODE(bref.unpack(sd, 24));
|
|
|
|
|
HANDLE_CODE(bref.unpack(mapped_hplmn_sst, 8));
|
|
|
|
|
HANDLE_CODE(bref.unpack(mapped_hplmn_sd, 24));
|
|
|
|
|
} else {
|
|
|
|
|
asn1::log_error("Not such a length type for s_nssai");
|
|
|
|
|
asn1::log_error("Not such a type for s_nssai");
|
|
|
|
|
return SRSASN_ERROR_DECODE_FAIL;
|
|
|
|
|
}
|
|
|
|
|
return SRSASN_SUCCESS;
|
|
|
|
@ -3359,6 +3416,7 @@ SRSASN_CODE dnn_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.2.1B
|
|
|
|
|
SRSASN_CODE dnn_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 1 || length > 100) {
|
|
|
|
|
asn1::log_error("Decoding Failed (DNN): Length (%d) is not in range of min: 1 and max 100 bytes", length);
|
|
|
|
@ -3394,6 +3452,7 @@ SRSASN_CODE additional_information_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.2.1
|
|
|
|
|
SRSASN_CODE additional_information_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Additional information): Length (%d) is not in range of min: 1 bytes", length);
|
|
|
|
@ -3524,6 +3583,7 @@ SRSASN_CODE capability_5gsm_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.1
|
|
|
|
|
SRSASN_CODE capability_5gsm_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 1 || length > 13) {
|
|
|
|
|
asn1::log_error("Decoding Failed (5GSM capability): Length (%d) is not in range of min: 1 and max 13 bytes",
|
|
|
|
@ -3603,6 +3663,7 @@ SRSASN_CODE sm_pdu_dn_request_container_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.15
|
|
|
|
|
SRSASN_CODE sm_pdu_dn_request_container_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 1 || length > 253) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
@ -3628,7 +3689,7 @@ SRSASN_CODE extended_protocol_configuration_options_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
bref.align_bytes_zero();
|
|
|
|
|
uint16_t length = (uint16_t)(ceilf((float)bref.distance(bref_length) / 8) - 2);
|
|
|
|
|
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 1) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
|
"Encoding Failed (Extended protocol configuration options): Packed length (%d) is not in range of min: 1 bytes",
|
|
|
|
@ -3643,8 +3704,9 @@ SRSASN_CODE extended_protocol_configuration_options_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.6
|
|
|
|
|
SRSASN_CODE extended_protocol_configuration_options_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 1) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
|
"Decoding Failed (Extended protocol configuration options): Length (%d) is not in range of min: 1 bytes",
|
|
|
|
@ -3670,7 +3732,7 @@ SRSASN_CODE ip_header_compression_configuration_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
bref.align_bytes_zero();
|
|
|
|
|
uint8_t length = (uint8_t)(ceilf((float)bref.distance(bref_length) / 8) - 1);
|
|
|
|
|
|
|
|
|
|
// MAX 255 not check because auf uint overflow
|
|
|
|
|
// max. length of 255 not checked: uint overflow
|
|
|
|
|
if (length < 3) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
|
"Encoding Failed (IP header compression configuration): Packed length (%d) is not in range of min: 3 bytes",
|
|
|
|
@ -3685,8 +3747,9 @@ SRSASN_CODE ip_header_compression_configuration_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.24
|
|
|
|
|
SRSASN_CODE ip_header_compression_configuration_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
// MAX 255 not check because auf uint overflow
|
|
|
|
|
// max. length of 255 not checked: uint overflow
|
|
|
|
|
if (length < 3) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
|
"Decoding Failed (IP header compression configuration): Length (%d) is not in range of min: 3 bytes", length);
|
|
|
|
@ -3725,6 +3788,7 @@ SRSASN_CODE ds_tt__ethernet_port_mac_address_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.25
|
|
|
|
|
SRSASN_CODE ds_tt__ethernet_port_mac_address_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 6) {
|
|
|
|
|
asn1::log_error("Decoding Failed (DS-TT Ethernet port MAC address): Length (%d) does not equal expected length 6",
|
|
|
|
@ -3761,6 +3825,7 @@ SRSASN_CODE ue_ds_tt_residence_time_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.26
|
|
|
|
|
SRSASN_CODE ue_ds_tt_residence_time_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 8) {
|
|
|
|
|
asn1::log_error("Decoding Failed (UE-DS-TT residence time): Length (%d) does not equal expected length 8", length);
|
|
|
|
@ -3783,7 +3848,7 @@ SRSASN_CODE port_management_information_container_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
bref.align_bytes_zero();
|
|
|
|
|
uint16_t length = (uint16_t)(ceilf((float)bref.distance(bref_length) / 8) - 2);
|
|
|
|
|
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 1) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
|
"Encoding Failed (Port management information container): Packed length (%d) is not in range of min: 1 bytes",
|
|
|
|
@ -3798,8 +3863,9 @@ SRSASN_CODE port_management_information_container_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.27
|
|
|
|
|
SRSASN_CODE port_management_information_container_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 1) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
|
"Decoding Failed (Port management information container): Length (%d) is not in range of min: 1 bytes", length);
|
|
|
|
@ -3839,6 +3905,7 @@ SRSASN_CODE ethernet_header_compression_configuration_t::pack(asn1::bit_ref& bre
|
|
|
|
|
// Reference: 9.11.4.28
|
|
|
|
|
SRSASN_CODE ethernet_header_compression_configuration_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
@ -3894,6 +3961,7 @@ SRSASN_CODE pdu_address_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.10
|
|
|
|
|
SRSASN_CODE pdu_address_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 5 || length > 29) {
|
|
|
|
|
asn1::log_error("Decoding Failed (PDU address): Length (%d) is not in range of min: 5 and max 29 bytes", length);
|
|
|
|
@ -3940,7 +4008,7 @@ SRSASN_CODE qo_s_rules_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
bref.align_bytes_zero();
|
|
|
|
|
uint16_t length = (uint16_t)(ceilf((float)bref.distance(bref_length) / 8) - 2);
|
|
|
|
|
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 4) {
|
|
|
|
|
asn1::log_error("Encoding Failed (QoS rules): Packed length (%d) is not in range of min: 4 bytes", length);
|
|
|
|
|
return asn1::SRSASN_ERROR_ENCODE_FAIL;
|
|
|
|
@ -3953,8 +4021,9 @@ SRSASN_CODE qo_s_rules_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.13
|
|
|
|
|
SRSASN_CODE qo_s_rules_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 4) {
|
|
|
|
|
asn1::log_error("Decoding Failed (QoS rules): Length (%d) is not in range of min: 4 bytes", length);
|
|
|
|
|
return asn1::SRSASN_ERROR_DECODE_FAIL;
|
|
|
|
@ -3991,6 +4060,7 @@ SRSASN_CODE session_ambr_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.14
|
|
|
|
|
SRSASN_CODE session_ambr_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 6) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Session-AMBR): Length (%d) does not equal expected length 6", length);
|
|
|
|
@ -4070,7 +4140,7 @@ SRSASN_CODE mapped_eps_bearer_contexts_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
bref.align_bytes_zero();
|
|
|
|
|
uint16_t length = (uint16_t)(ceilf((float)bref.distance(bref_length) / 8) - 2);
|
|
|
|
|
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 4) {
|
|
|
|
|
asn1::log_error("Encoding Failed (Mapped EPS bearer contexts): Packed length (%d) is not in range of min: 4 bytes",
|
|
|
|
|
length);
|
|
|
|
@ -4084,8 +4154,9 @@ SRSASN_CODE mapped_eps_bearer_contexts_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.8
|
|
|
|
|
SRSASN_CODE mapped_eps_bearer_contexts_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 4) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Mapped EPS bearer contexts): Length (%d) is not in range of min: 4 bytes",
|
|
|
|
|
length);
|
|
|
|
@ -4110,7 +4181,7 @@ SRSASN_CODE qo_s_flow_descriptions_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
bref.align_bytes_zero();
|
|
|
|
|
uint16_t length = (uint16_t)(ceilf((float)bref.distance(bref_length) / 8) - 2);
|
|
|
|
|
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 3) {
|
|
|
|
|
asn1::log_error("Encoding Failed (QoS flow descriptions): Packed length (%d) is not in range of min: 3 bytes",
|
|
|
|
|
length);
|
|
|
|
@ -4124,8 +4195,9 @@ SRSASN_CODE qo_s_flow_descriptions_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.12
|
|
|
|
|
SRSASN_CODE qo_s_flow_descriptions_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
if (length < 3) {
|
|
|
|
|
asn1::log_error("Decoding Failed (QoS flow descriptions): Length (%d) is not in range of min: 3 bytes", length);
|
|
|
|
|
return asn1::SRSASN_ERROR_DECODE_FAIL;
|
|
|
|
@ -4165,6 +4237,7 @@ SRSASN_CODE network_feature_support_5gsm_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.18
|
|
|
|
|
SRSASN_CODE network_feature_support_5gsm_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length < 1 || length > 13) {
|
|
|
|
|
asn1::log_error(
|
|
|
|
@ -4207,6 +4280,7 @@ SRSASN_CODE serving_plmn_rate_control_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.20
|
|
|
|
|
SRSASN_CODE serving_plmn_rate_control_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 2) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Serving PLMN rate control): Length (%d) does not equal expected length 2",
|
|
|
|
@ -4229,8 +4303,8 @@ SRSASN_CODE atsss_container_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
bref.align_bytes_zero();
|
|
|
|
|
uint16_t length = (uint16_t)(ceilf((float)bref.distance(bref_length) / 8) - 2);
|
|
|
|
|
|
|
|
|
|
// MIN 0 not check because auf uint underflow
|
|
|
|
|
// MAX 65535 not check because auf uint overflow
|
|
|
|
|
// min. length of 0 not checked: uint underflow
|
|
|
|
|
// max. length of 65535 not checked: uint overflow
|
|
|
|
|
HANDLE_CODE(bref_length.pack(length, 16));
|
|
|
|
|
return SRSASN_SUCCESS;
|
|
|
|
|
}
|
|
|
|
@ -4239,12 +4313,9 @@ SRSASN_CODE atsss_container_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.22
|
|
|
|
|
SRSASN_CODE atsss_container_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint16_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 16));
|
|
|
|
|
// MIN 0 not check because auf uint underflow
|
|
|
|
|
if (length > 65535) {
|
|
|
|
|
asn1::log_error("Decoding Failed (ATSSS container): Length (%d) is not in range of max 65535 bytes", length);
|
|
|
|
|
return asn1::SRSASN_ERROR_DECODE_FAIL;
|
|
|
|
|
}
|
|
|
|
|
// min. length of 0 not checked: uint underflow
|
|
|
|
|
nas_message_container.resize(length);
|
|
|
|
|
HANDLE_CODE(bref.unpack_bytes(nas_message_container.data(), length));
|
|
|
|
|
return SRSASN_SUCCESS;
|
|
|
|
@ -4343,6 +4414,7 @@ SRSASN_CODE re_attempt_indicator_t::pack(asn1::bit_ref& bref)
|
|
|
|
|
// Reference: 9.11.4.17
|
|
|
|
|
SRSASN_CODE re_attempt_indicator_t::unpack(asn1::cbit_ref& bref)
|
|
|
|
|
{
|
|
|
|
|
uint8_t length = 0;
|
|
|
|
|
HANDLE_CODE(bref.unpack(length, 8));
|
|
|
|
|
if (length != 1) {
|
|
|
|
|
asn1::log_error("Decoding Failed (Re-attempt indicator): Length (%d) does not equal expected length 1", length);
|
|
|
|
|