pespin submitted this change.
udm: TC_auth_info_retrieve: Expect UDM to increment SQN when issuing auth vector
open5gs.git aea6708bd246504adfb72fa3e17918f0a88fbb70 recently applied
multiple fixes related to SQN advance when generating an auth vector.
As a result, after GET ../authentication-subscription, the UDM will
request a PATCH for the same path/object, incrementing SQN on it.
Adapt the test to expect the PATCH message.
Related: https://github.com/open5gs/open5gs/issues/5000
Change-Id: Ife3ed372a777477d9b71c6f4764f925f20aa2127
---
M library/TS29505_Subscription_Data_Templates.ttcn
M udm/ConnHdlr.ttcn
M udm/gen_links.sh
3 files changed, 61 insertions(+), 4 deletions(-)
diff --git a/library/TS29505_Subscription_Data_Templates.ttcn b/library/TS29505_Subscription_Data_Templates.ttcn
index 00db772..c592077 100644
--- a/library/TS29505_Subscription_Data_Templates.ttcn
+++ b/library/TS29505_Subscription_Data_Templates.ttcn
@@ -46,8 +46,12 @@
enum_val := enum_val
}
+template (present) PatchOperation
+tr_PatchOperation(template (present) PatchOperation_enum enum_val := ?) := {
+ enum_val := enum_val
+}
template (value) PatchOperation
-ts_PatchOperation(PatchOperation_enum enum_val) := {
+ts_PatchOperation(template (value) PatchOperation_enum enum_val) := {
enum_val := enum_val
}
@@ -79,6 +83,16 @@
enum_val := enum_val
}
+template (present) PatchItem
+tr_PatchItem(template (present) PatchOperation op,
+ template (present) charstring path,
+ template charstring from_ := *,
+ template JSON_Generic.JSON_generic_val value_ := *) := {
+ op := op,
+ path := path,
+ from_ := from_,
+ value_ := value_
+}
template (value) PatchItem
ts_PatchItem(template (value) PatchOperation op,
template (value) charstring path,
diff --git a/udm/ConnHdlr.ttcn b/udm/ConnHdlr.ttcn
index 0a7ab1c..99cce49 100644
--- a/udm/ConnHdlr.ttcn
+++ b/udm/ConnHdlr.ttcn
@@ -30,6 +30,7 @@
import from Prometheus_Checker all;
+import from JSON_Generic_Templates all;
import from TS29503_Nudm_UEAU all;
import from TS29503_Nudm_UEAU_Templates all;
import from TS29505_Subscription_Data all;
@@ -151,6 +152,7 @@
var HTTP2_Msg http2_rx;
var template (present) HTTP2_Msg http2_exp_rx;
var template (value) AuthenticationInfoRequest1 auth_info_req;
+ var template (present) PatchItem_list patch_item_li;
auth_info_req := ts_AuthenticationInfoRequest1(servingNetworkName := g_pars.serving_network,
ausfInstanceId := g_pars.ausf_instance_id);
@@ -160,6 +162,11 @@
as_Nudr_DR_get_authentication_subscription();
+ patch_item_li := { tr_PatchItem(op := tr_PatchOperation(replace_),
+ path := "/sequenceNumber/sqn",
+ value_ := tr_JSON_generic_val_string(pattern "????????????")) }
+ as_Nudr_DR_patch_authentication_subscription(patch_item_li);
+
/* 3GPP TS 29.503 Table 6.3.3.2.4.2.2-2 */
http2_exp_rx :=
tr_HTTP2_Msg(http2_tx.conn_id,
@@ -328,7 +335,7 @@
return http2_msg;
}
-/* 3GPP TS 29.505 5.2.2 Resource: AuthenticationSubscription */
+/* 3GPP TS 29.505 5.2.2 Resource: AuthenticationSubscription (GET) */
altstep as_Nudr_DR_get_authentication_subscription()
runs on ConnHdlr {
var HTTP2_Msg http2_rx;
@@ -339,11 +346,12 @@
auth_sub := ts_AuthenticationSubscription(ts_AuthMethod(FiveG_AKA),
encPermanentKey := "3c6e0b8a9c15224a8228b9a98ca1531d",
- sequenceNumber := ts_SequenceNumber(sqn := "0"),
+ sequenceNumber := ts_SequenceNumber(sqn := "000000000000"),
authenticationManagementField := "8000",
encOpcKey := "762a2206fe0b4151ace403c86a11e479");
body_enc := f_enc_AuthenticationSubscription(valueof(auth_sub));
+ /* Table 5.2.2.3.1-3 */
http2_tx := ts_HTTP2_Msg_200_OK(http2_rx.conn_id,
http2_rx.stream_id,
headers := {
@@ -357,6 +365,41 @@
}
}
+/* 3GPP TS 29.505 5.2.2.3.2 AuthenticationSubscription (PATCH) */
+function f_tr_Nudr_DR_patch_authentication_subscription(template (present) PatchItem_list patch_item_li := ?)
+runs on ConnHdlr return template (present) HTTP2_Msg {
+ var template (present) HTTP2_Msg http2_msg;
+ var template (present) HTTP2_header_block hb;
+ var template (present) HTTP2_pseudo_headers pseudo_headers;
+ var template HTTP2_header_list headers := *;
+
+ pseudo_headers := tr_HTTP2_pseudo_headers_Req(method := "PATCH",
+ path := tr_Nudr_DR_path_authentication_subscription(g_pars.imsi_str));
+ hb := tr_HTTP2_header_block(pseudo_headers, headers);
+ http2_msg := tr_HTTP2_Msg(?, ?,
+ hb := hb,
+ body := tr_HTTP2_Data_frame(data := decmatch patch_item_li));
+ return http2_msg;
+}
+
+/* 3GPP TS 29.505 5.2.2 Resource: AuthenticationSubscription (PATCH) */
+altstep as_Nudr_DR_patch_authentication_subscription(template (present) PatchItem_list patch_item_li := ?)
+runs on ConnHdlr {
+ var HTTP2_Msg http2_rx;
+ [] HTTP2_CONN[HTTP2_CONN_SCP].receive(f_tr_Nudr_DR_patch_authentication_subscription(patch_item_li)) -> value http2_rx {
+ var template (value) HTTP2_Msg http2_tx;
+
+ /* Table 5.2.2.3.2-3 */
+ http2_tx := ts_HTTP2_Msg_204_No_Content(http2_rx.conn_id,
+ http2_rx.stream_id,
+ headers := {
+ ts_HTTP2_Hdr_content_type("application/json")
+ });
+ HTTP2_CONN[HTTP2_CONN_SCP].send(http2_tx);
+ setverdict(pass);
+ }
+}
+
/* 3GPP TS 29.505 5.2.24.3.1 Resource: AuthenticationStatus (PUT) */
function f_tr_Nudr_DR_put_authentication_status()
runs on ConnHdlr return template (present) HTTP2_Msg {
diff --git a/udm/gen_links.sh b/udm/gen_links.sh
index d50f68b..72c9e09 100755
--- a/udm/gen_links.sh
+++ b/udm/gen_links.sh
@@ -46,7 +46,7 @@
FILES+="SCTP_Templates.ttcn "
FILES+="HTTP2_CodecPort.ttcn HTTP2_CodecPort_CtrlFunct.ttcn HTTP2_CodecPort_CtrlFunctDef.cc HTTP2_Templates.ttcn HTTP2_Functions.ttcn HTTP2_Msg.ttcn HTTP2_Adapter.ttcn HTTP2_Server_Emulation.ttcn "
FILES+="HTTP_Adapter.ttcn Prometheus_Checker.ttcn "
-FILES+="TS29571_CommonData_Templates.ttcn TS29503_Nudm_UEAU_Templates.ttcn TS29505_Subscription_Data_Templates.ttcn "
+FILES+="JSON_Generic_Templates.ttcn TS29571_CommonData_Templates.ttcn TS29503_Nudm_UEAU_Templates.ttcn TS29505_Subscription_Data_Templates.ttcn "
gen_links $DIR $FILES
gen_links_finish
To view, visit change 44156. To unsubscribe, or for help writing mail filters, visit settings.