[MERGED] osmo-msc[master]: msc_vlr_tests: clearly separate Ciph Mode from Security Mode...

2018-03-10 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: msc_vlr_tests: clearly separate Ciph Mode from Security Mode 
checking
..


msc_vlr_tests: clearly separate Ciph Mode from Security Mode checking

Clearly distinguish between Ciphering Mode Command on GERAN and Security Mode
Control on UTRAN.

Cosmetic: explicitly verify the key strings in the testing code (not only in
the expected output).

Change-Id: Ica93ed06c4c63dc6768736d25231de8068001114
---
M tests/msc_vlr/msc_vlr_test_authen_reuse.c
M tests/msc_vlr/msc_vlr_test_authen_reuse.err
M tests/msc_vlr/msc_vlr_test_call.c
M tests/msc_vlr/msc_vlr_test_call.err
M tests/msc_vlr/msc_vlr_test_gsm_ciph.c
M tests/msc_vlr/msc_vlr_test_umts_authen.c
M tests/msc_vlr/msc_vlr_test_umts_authen.err
M tests/msc_vlr/msc_vlr_tests.c
M tests/msc_vlr/msc_vlr_tests.h
9 files changed, 98 insertions(+), 48 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.c 
b/tests/msc_vlr/msc_vlr_test_authen_reuse.c
index e78ab06..6fd1e66 100644
--- a/tests/msc_vlr/msc_vlr_test_authen_reuse.c
+++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.c
@@ -105,9 +105,9 @@
} else {
/* On UTRAN */
btw("MS sends Authen Response, VLR accepts and sends 
SecurityModeControl");
-   cipher_mode_cmd_sent = false;
+   expect_security_mode_ctrl(NULL, 
"27497388b6cb044648f396aa155b95ef");
ms_sends_msg("0554" "e229c19e" "2104" "791f2e41");
-   VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d");
+   VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d");
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
 
btw("MS sends SecurityModeControl acceptance, VLR accepts and 
sends GSUP LU Req to HLR");
@@ -179,9 +179,9 @@
} else {
/* On UTRAN */
btw("MS sends Authen Response, VLR accepts and sends 
SecurityModeControl");
-   cipher_mode_cmd_sent = false;
+   expect_security_mode_ctrl(NULL, 
"27497388b6cb044648f396aa155b95ef");
ms_sends_msg("0554" "e229c19e" "2104" "791f2e41");
-   VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d");
+   VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d");
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, 
"%d");
 
btw("MS sends SecurityModeControl acceptance, VLR 
accepts; above Ciphering is an implicit CM Service Accept");
@@ -253,9 +253,9 @@
} else {
/* On UTRAN */
btw("MS sends Authen Response, VLR accepts and sends 
SecurityModeControl");
-   cipher_mode_cmd_sent = false;
+   expect_security_mode_ctrl(NULL, 
"1159ec926a50e98c034a6b7d7c9f418d");
ms_sends_msg("0554" "7db47cf7" "2104" "f81e4dc7"); /* 
2nd vector's res, s.a. */
-   VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d");
+   VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d");
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, 
"%d");
 
btw("MS sends SecurityModeControl acceptance, VLR 
accepts; above Ciphering is an implicit CM Service Accept");
diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err 
b/tests/msc_vlr/msc_vlr_test_authen_reuse.err
index ea3b989..269cd35 100644
--- a/tests/msc_vlr/msc_vlr_test_authen_reuse.err
+++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err
@@ -497,7 +497,7 @@
 DVLR vlr_lu_fsm(90170010650){VLR_ULA_S_WAIT_AUTH}: state_chg to 
VLR_ULA_S_WAIT_CIPH
 DMM IMSI:90170010650: bump: conn still being established 
(SUBSCR_CONN_S_NEW)
 DREF IMSI:90170010650: MSC conn use - dtap == 1 (0x4)
-  cipher_mode_cmd_sent == 1
+  security_mode_ctrl_sent == 1
   lu_result_sent == 0
 - MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req 
to HLR
 DMM <- SECURITY MODE COMPLETE IMSI:90170010650
@@ -677,7 +677,7 @@
 DVLR Process_Access_Request_VLR(90170010650){PR_ARQ_S_WAIT_AUTH}: 
state_chg to PR_ARQ_S_WAIT_CIPH
 DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW)
 DREF MSISDN:42342: MSC conn use - dtap == 1 (0x4)
-  cipher_mode_cmd_sent == 1
+  security_mode_ctrl_sent == 1
   cm_service_result_sent == 0
 - MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an 
implicit CM Service Accept
 DMM <- SECURITY MODE COMPLETE MSISDN:42342
@@ -808,7 +808,7 @@
 DVLR Process_Access_Request_VLR(90170010650){PR_ARQ_S_WAIT_AUTH}: 
state_chg to PR_ARQ_S_WAIT_CIPH
 DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW)
 DREF MSISDN:42342: MSC conn use - dtap == 1 (0x4)
-  

osmo-msc[master]: msc_vlr_tests: clearly separate Ciph Mode from Security Mode...

2018-03-10 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7185
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ica93ed06c4c63dc6768736d25231de8068001114
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-msc[master]: msc_vlr_tests: clearly separate Ciph Mode from Security Mode...

2018-03-09 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/7185

msc_vlr_tests: clearly separate Ciph Mode from Security Mode checking

Clearly distinguish between Ciphering Mode Command on GERAN and Security Mode
Control on UTRAN.

Cosmetic: explicitly verify the key strings in the testing code (not only in
the expected output).

Change-Id: Ica93ed06c4c63dc6768736d25231de8068001114
---
M tests/msc_vlr/msc_vlr_test_authen_reuse.c
M tests/msc_vlr/msc_vlr_test_authen_reuse.err
M tests/msc_vlr/msc_vlr_test_call.c
M tests/msc_vlr/msc_vlr_test_call.err
M tests/msc_vlr/msc_vlr_test_gsm_ciph.c
M tests/msc_vlr/msc_vlr_test_umts_authen.c
M tests/msc_vlr/msc_vlr_test_umts_authen.err
M tests/msc_vlr/msc_vlr_tests.c
M tests/msc_vlr/msc_vlr_tests.h
9 files changed, 98 insertions(+), 48 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/85/7185/1

diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.c 
b/tests/msc_vlr/msc_vlr_test_authen_reuse.c
index e78ab06..6fd1e66 100644
--- a/tests/msc_vlr/msc_vlr_test_authen_reuse.c
+++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.c
@@ -105,9 +105,9 @@
} else {
/* On UTRAN */
btw("MS sends Authen Response, VLR accepts and sends 
SecurityModeControl");
-   cipher_mode_cmd_sent = false;
+   expect_security_mode_ctrl(NULL, 
"27497388b6cb044648f396aa155b95ef");
ms_sends_msg("0554" "e229c19e" "2104" "791f2e41");
-   VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d");
+   VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d");
VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
 
btw("MS sends SecurityModeControl acceptance, VLR accepts and 
sends GSUP LU Req to HLR");
@@ -179,9 +179,9 @@
} else {
/* On UTRAN */
btw("MS sends Authen Response, VLR accepts and sends 
SecurityModeControl");
-   cipher_mode_cmd_sent = false;
+   expect_security_mode_ctrl(NULL, 
"27497388b6cb044648f396aa155b95ef");
ms_sends_msg("0554" "e229c19e" "2104" "791f2e41");
-   VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d");
+   VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d");
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, 
"%d");
 
btw("MS sends SecurityModeControl acceptance, VLR 
accepts; above Ciphering is an implicit CM Service Accept");
@@ -253,9 +253,9 @@
} else {
/* On UTRAN */
btw("MS sends Authen Response, VLR accepts and sends 
SecurityModeControl");
-   cipher_mode_cmd_sent = false;
+   expect_security_mode_ctrl(NULL, 
"1159ec926a50e98c034a6b7d7c9f418d");
ms_sends_msg("0554" "7db47cf7" "2104" "f81e4dc7"); /* 
2nd vector's res, s.a. */
-   VERBOSE_ASSERT(cipher_mode_cmd_sent, == true, "%d");
+   VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d");
VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, 
"%d");
 
btw("MS sends SecurityModeControl acceptance, VLR 
accepts; above Ciphering is an implicit CM Service Accept");
diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err 
b/tests/msc_vlr/msc_vlr_test_authen_reuse.err
index ea3b989..269cd35 100644
--- a/tests/msc_vlr/msc_vlr_test_authen_reuse.err
+++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err
@@ -497,7 +497,7 @@
 DVLR vlr_lu_fsm(90170010650){VLR_ULA_S_WAIT_AUTH}: state_chg to 
VLR_ULA_S_WAIT_CIPH
 DMM IMSI:90170010650: bump: conn still being established 
(SUBSCR_CONN_S_NEW)
 DREF IMSI:90170010650: MSC conn use - dtap == 1 (0x4)
-  cipher_mode_cmd_sent == 1
+  security_mode_ctrl_sent == 1
   lu_result_sent == 0
 - MS sends SecurityModeControl acceptance, VLR accepts and sends GSUP LU Req 
to HLR
 DMM <- SECURITY MODE COMPLETE IMSI:90170010650
@@ -677,7 +677,7 @@
 DVLR Process_Access_Request_VLR(90170010650){PR_ARQ_S_WAIT_AUTH}: 
state_chg to PR_ARQ_S_WAIT_CIPH
 DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW)
 DREF MSISDN:42342: MSC conn use - dtap == 1 (0x4)
-  cipher_mode_cmd_sent == 1
+  security_mode_ctrl_sent == 1
   cm_service_result_sent == 0
 - MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an 
implicit CM Service Accept
 DMM <- SECURITY MODE COMPLETE MSISDN:42342
@@ -808,7 +808,7 @@
 DVLR Process_Access_Request_VLR(90170010650){PR_ARQ_S_WAIT_AUTH}: 
state_chg to PR_ARQ_S_WAIT_CIPH
 DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW)
 DREF MSISDN:42342: MSC conn use - dtap == 1 (0x4)
-  cipher_mode_cmd_sent == 1
+  security_mode_ctrl_sent == 1
   cm_service_result_sent == 0
 - MS sends SecurityModeControl acceptance, VLR accepts; above Ciphering is an 
implicit CM