pespin submitted this change.

View Change

Approvals: fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, approved Jenkins Builder: Verified
ausf: Fix ResStar with wrong length being sent

Since open5gs.git 068881e88a721b4f35878d7ca4227fc923bca98b,
open5gs-ausfd checks the length of the ResStar being sent.
Hence, fix the test checking the correct path and add an extra test
checking the incorrect-length path.

Change-Id: I8db7f2c773e3c40b9b1dd115dd2d073b73992c4e
---
M ausf/AUSF_Tests.ttcn
M ausf/ConnHdlr.ttcn
M ausf/expected-results.xml
3 files changed, 42 insertions(+), 12 deletions(-)

diff --git a/ausf/AUSF_Tests.ttcn b/ausf/AUSF_Tests.ttcn
index ff36313..b069f07 100644
--- a/ausf/AUSF_Tests.ttcn
+++ b/ausf/AUSF_Tests.ttcn
@@ -129,9 +129,25 @@
f_shutdown();
}

+/* 3GPP TS 29.509 5.2.2.2.2 5G AKA, sending a resStar shorter than expected (32 chars) */
+private function f_TC_5g_aka_short_resStar() runs on ConnHdlr {
+ f_n12_post_ue_authentications();
+ f_n12_put_5g_aka_confirmation(resStar := "", exp_res_code := 400);
+ setverdict(pass);
+}
+testcase TC_5g_aka_short_resStar() runs on MTC_CT {
+ var ConnHdlr vc_conn;
+ var ConnHdlrPars pars := f_ConnHdlrPars(0);
+ f_init();
+ vc_conn := f_start_handler(refers(f_TC_5g_aka_short_resStar), pars);
+ vc_conn.done;
+ f_shutdown();
+}
+

control {
execute( TC_5g_aka() );
+ execute( TC_5g_aka_short_resStar() );
}

}
diff --git a/ausf/ConnHdlr.ttcn b/ausf/ConnHdlr.ttcn
index dacfa1d..1fde3c5 100644
--- a/ausf/ConnHdlr.ttcn
+++ b/ausf/ConnHdlr.ttcn
@@ -213,28 +213,41 @@
}

/* 3GPP TS 29.509 6.1.3.3.3.1 Resource: 5g-aka-confirmation (PUT) */
-function f_n12_put_5g_aka_confirmation()
+function f_n12_put_5g_aka_confirmation(template (value) charstring resStar := "0123456789abcdef0123456789abcdef",
+ integer exp_res_code := 200)
runs on ConnHdlr {
var HTTP2_Msg http2_tx;
var HTTP2_Msg http2_rx;
var template (present) HTTP2_Msg http2_exp_rx;
var template (value) ConfirmationData conf_data;

- conf_data := ts_ConfirmationData(resStar := ts_ResStar(""));
+ conf_data := ts_ConfirmationData(resStar := ts_ResStar(resStar));

http2_tx := f_n12_prepare_put_5g_aka_confirmation(valueof(conf_data));
f_http2_adapter_connect_send_ausf(http2_tx, idx := http2_tx.conn_id);

- as_Nudm_UEAU_post_auth_events();
-
/* 3GPP TS 29.503 Table 6.3.3.2.4.2.2-2 */
- http2_exp_rx :=
- tr_HTTP2_Msg(http2_tx.conn_id,
- http2_tx.stream_id,
- tr_HTTP2_header_block(pseudo_headers := tr_HTTP2_pseudo_headers_Resp(200)),
- tr_HTTP2_Data_frame(stream_id := http2_tx.stream_id,
- end_stream_flag := true,
- data := decmatch tr_ConfirmationDataResponse));
+ select (exp_res_code) {
+ case (200) {
+ as_Nudm_UEAU_post_auth_events();
+ http2_exp_rx :=
+ tr_HTTP2_Msg(http2_tx.conn_id,
+ http2_tx.stream_id,
+ tr_HTTP2_header_block(pseudo_headers := tr_HTTP2_pseudo_headers_Resp(200)),
+ tr_HTTP2_Data_frame(stream_id := http2_tx.stream_id,
+ end_stream_flag := true,
+ data := decmatch tr_ConfirmationDataResponse));
+ }
+ case (400) {
+ http2_exp_rx :=
+ tr_HTTP2_Msg(http2_tx.conn_id,
+ http2_tx.stream_id,
+ tr_HTTP2_header_block(pseudo_headers := tr_HTTP2_pseudo_headers_Resp(400)),
+ tr_HTTP2_Data_frame(stream_id := http2_tx.stream_id,
+ end_stream_flag := true,
+ data := ? ));
+ }
+ }
as_http2_adapter_receive(http2_rx, http2_exp_rx, idx := http2_tx.conn_id);

f_http2_adapter_close(idx := http2_tx.conn_id);
diff --git a/ausf/expected-results.xml b/ausf/expected-results.xml
index 7e1d439..d4a9e9b 100644
--- a/ausf/expected-results.xml
+++ b/ausf/expected-results.xml
@@ -1,4 +1,5 @@
<?xml version="1.0"?>
-<testsuite name='Titan' tests='1' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'>
+<testsuite name='Titan' tests='2' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'>
<testcase classname='AUSF_Tests' name='TC_5g_aka' time='MASKED'/>
+ <testcase classname='AUSF_Tests' name='TC_5g_aka_short_resStar' time='MASKED'/>
</testsuite>

To view, visit change 44162. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I8db7f2c773e3c40b9b1dd115dd2d073b73992c4e
Gerrit-Change-Number: 44162
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>