pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27293 )
Change subject: pcu: usse alive-type for NS and BSSGP created components
......................................................................
pcu: usse alive-type for NS and BSSGP created components
Internal BVC components in BSSGP are now created as alive. We have to
create also BSSGP one as alive in order to avoid having the BVC
component sending stuff to the BSSGP when it has already been killed:
BSSGP_Emulation.ttcnpp:1133 Dynamic test case error: Sending data on the connection of port BVC to 486:BVC failed. (Broken pipe)
Change-Id: I369a5e2246204416c2f29a114bde6bc21f7eaf4f
---
M pcu/SGSN_Components.ttcn
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/93/27293/1
diff --git a/pcu/SGSN_Components.ttcn b/pcu/SGSN_Components.ttcn
index a55d791..bbac9b0 100644
--- a/pcu/SGSN_Components.ttcn
+++ b/pcu/SGSN_Components.ttcn
@@ -108,8 +108,8 @@
g_initialized := true;
/* create a new NS component */
- ns_component := NS_CT.create;
- bssgp_component := BSSGP_CT.create;
+ ns_component := NS_CT.create alive;
+ bssgp_component := BSSGP_CT.create alive;
/* connect lower-end of BSSGP with BSSGP_CODEC_PORT (maps to NS_PT*/
connect(bssgp_component:BSCP, ns_component:NS_SP);
connect(self:PROC, bssgp_component:PROC);
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27293
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I369a5e2246204416c2f29a114bde6bc21f7eaf4f
Gerrit-Change-Number: 27293
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: dexter.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27292 )
Change subject: cosmetics around select_best_cipher()
......................................................................
Patch Set 1: Code-Review-1
(1 comment)
Patchset:
PS1:
This one doesn't seem to be needed for a backport.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27292
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: 2021q4
Gerrit-Change-Id: Iaed6b97c31e4ccb1f28ca7e64596d5e20563b392
Gerrit-Change-Number: 27292
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 22 Feb 2022 15:48:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27291 )
Change subject: fix inter-BSC-in handover encryption
......................................................................
fix inter-BSC-in handover encryption
In the field we saw Handover Requests without any Chosen Encryption
Algorithm IE, and osmo-bsc completely failed on those. This made me
understand my mistake from when I wrote this handover code.
So far, from a BSSMAP Handover Request, we (I) used only the Chosen
Encryption Algorithm IE to pick the encryption to use on the target
lchan. That is very wrong.
Instead, figure out the intersection of permitted algorithms MSC & BSC,
and pick the best of those. Which means, actually, completely ignore the
Chosen Encryption Algorithm IE.
In the message, the permitted algorithms are passed as a bitmask. The
current code using gsm0808_dec_encrypt_info() passes this on as an
array. In order to select_best_cipher(), I could convert that array back
to a bitmask. Instead pass the bitmask on from message decoding
alongside the struct gsm0808_encrypt_info in req->ei_as_bitmask.
In handover_end(), change the condition so that we can also pass
HO_RESULT_FAIL_RR_HO_FAIL to emit a Handover Failure.
Related: SYS#5839
Change-Id: Iffedc981b60d309ed2e5decd5efedee07a757b53
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/handover_fsm.c
M src/osmo-bsc/osmo_bsc_bssap.c
3 files changed, 26 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/91/27291/1
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 7657a5f..a1aa2df 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -250,6 +250,8 @@
struct gsm0808_channel_type ct;
struct gsm0808_speech_codec_list scl;
struct gsm0808_encrypt_info ei;
+ /* The same information as in 'ei' but as the handy bitmask as on the wire. */
+ uint8_t ei_as_bitmask;
bool kc128_present;
uint8_t kc128[16];
struct gsm_classmark classmark;
@@ -1435,4 +1437,6 @@
enum rsl_cmod_spd chan_mode_to_rsl_cmod_spd(enum gsm48_chan_mode chan_mode);
+int select_best_cipher(uint8_t msc_mask, uint8_t bsc_mask);
+
#endif /* _GSM_DATA_H */
diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index 37e7417..487135b 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -490,6 +490,7 @@
LOG_HO(conn, LOGL_ERROR, "Failed to parse Encryption Information IE\n");
return false;
}
+ req->ei_as_bitmask = *e->val;
if ((e = TLVP_GET(tp, GSM0808_IE_KC_128))) {
if (e->len != 16) {
@@ -630,6 +631,7 @@
int match_idx;
struct osmo_fsm_inst *fi;
struct channel_mode_and_rate ch_mode_rate = {};
+ int chosen_a5_n;
handover_fsm_alloc(conn);
@@ -717,16 +719,28 @@
.msc_assigned_cic = req->msc_assigned_cic,
};
- if (req->chosen_encr_alg) {
- info.encr.alg_id = req->chosen_encr_alg;
- if (info.encr.alg_id > 1 && !req->ei.key_len) {
- ho_fail(HO_RESULT_ERROR, "Chosen Encryption Algorithm (Serving) reflects A5/%u"
- " but there is no key (Encryption Information)", info.encr.alg_id - 1);
+ /* Figure out the encryption algorithm */
+ chosen_a5_n = select_best_cipher(req->ei_as_bitmask, bsc_gsmnet->a5_encryption_mask);
+ if (chosen_a5_n < 0) {
+ ho_fail(HO_RESULT_FAIL_RR_HO_FAIL,
+ "There is no A5 encryption mode that both BSC and MSC permit: MSC 0x%x & BSC 0x%x = 0\n",
+ req->ei_as_bitmask, bsc_gsmnet->a5_encryption_mask);
+ return;
+ }
+ if (chosen_a5_n > 0 && !req->ei.key_len) {
+ /* There is no key. Is A5/0 permitted? */
+ if ((req->ei_as_bitmask & bsc_gsmnet->a5_encryption_mask & 0x1) == 0x1) {
+ chosen_a5_n = 0;
+ } else {
+ ho_fail(HO_RESULT_ERROR,
+ "Encryption is required, but there is no key (Encryption Information)");
return;
}
}
- if (req->ei.key_len) {
+ /* Put encryption info in the chan activation info */
+ info.encr.alg_id = ALG_A5_NR_TO_RSL(chosen_a5_n);
+ if (chosen_a5_n > 0) {
if (req->ei.key_len > sizeof(info.encr.key)) {
ho_fail(HO_RESULT_ERROR, "Encryption Information IE key length is too large: %u\n",
req->ei.key_len);
@@ -965,7 +979,7 @@
result = bsc_tx_bssmap_ho_complete(conn, ho->new_lchan);
}
/* Not 'else': above checks may still result in HO_RESULT_ERROR. */
- if (result == HO_RESULT_ERROR) {
+ if (result != HO_RESULT_OK) {
/* Return a BSSMAP Handover Failure, as described in 3GPP TS 48.008 3.1.5.2.2
* "Handover Resource Allocation Failure" */
bsc_tx_bssmap_ho_failure(conn);
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index cf8254c..9d7b89f 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -394,7 +394,7 @@
}
/* select the best cipher permitted by the intersection of both masks */
-static int select_best_cipher(uint8_t msc_mask, uint8_t bsc_mask)
+int select_best_cipher(uint8_t msc_mask, uint8_t bsc_mask)
{
/* A5/7 ... A5/3: We assume higher is better,
* but: A5/1 is better than A5/2, which is better than A5/0 */
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27291
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: 2021q4
Gerrit-Change-Id: Iffedc981b60d309ed2e5decd5efedee07a757b53
Gerrit-Change-Number: 27291
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27292 )
Change subject: cosmetics around select_best_cipher()
......................................................................
cosmetics around select_best_cipher()
Improve the function doc. Remove a comment at a caller, because that
information is what the function doc is for.
Rename the array to codec_by_strength, because it is not the codec
strength but the codec number listed in the array.
Related: SYS#5839
Change-Id: Iaed6b97c31e4ccb1f28ca7e64596d5e20563b392
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 5 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/92/27292/1
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 9d7b89f..a4c2a3c 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -393,17 +393,18 @@
return 0;
}
-/* select the best cipher permitted by the intersection of both masks */
+/* Select the best cipher permitted by the intersection of both masks. Return as the n in A5/n, or -1 if the
+ * intersection is empty. */
int select_best_cipher(uint8_t msc_mask, uint8_t bsc_mask)
{
/* A5/7 ... A5/3: We assume higher is better,
* but: A5/1 is better than A5/2, which is better than A5/0 */
- const uint8_t codec_strength[8] = { 7, 6, 5, 4, 3, 1, 2, 0 };
+ const uint8_t codec_by_strength[8] = { 7, 6, 5, 4, 3, 1, 2, 0 };
uint8_t intersection = msc_mask & bsc_mask;
int i;
- for (i = 0; i < ARRAY_SIZE(codec_strength); i++) {
- uint8_t codec = codec_strength[i];
+ for (i = 0; i < ARRAY_SIZE(codec_by_strength); i++) {
+ uint8_t codec = codec_by_strength[i];
if (intersection & (1 << codec))
return codec;
}
@@ -509,9 +510,6 @@
* a5_encryption == 2 --> 0x04 ... */
enc_bits_msc = data[0];
- /* The bit-mask of permitted ciphers from the MSC (sent in ASSIGNMENT COMMAND) is intersected
- * with the vty-configured mask a the BSC. Finally, the best (highest) possible cipher is
- * chosen. */
chosen_cipher = select_best_cipher(enc_bits_msc, bsc_gsmnet->a5_encryption_mask);
if (chosen_cipher < 0) {
LOGP(DMSC, LOGL_ERROR, "Reject: no overlapping A5 ciphers between BSC (0x%02x) "
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27292
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: 2021q4
Gerrit-Change-Id: Iaed6b97c31e4ccb1f28ca7e64596d5e20563b392
Gerrit-Change-Number: 27292
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27290 )
Change subject: rename RSL_ENC_ALG_A5 to ALG_A5_NR_TO_RSL, clarify
......................................................................
rename RSL_ENC_ALG_A5 to ALG_A5_NR_TO_RSL, clarify
The naming confused me so that I wrote buggy code again. Hopefully this
clarifies which representations the code paths are using.
In the macro code, highlight the error case of n <= -1 explicitly.
Also add ALG_A5_NR_TO_PERM_ALG_BITS. I need the 1<<n case in an
upcoming patch.
Related: SYS#5839
Change-Id: I7557ae97764bba09c906748a18e9031dfb362611
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/gsm_04_08_rr.c
M src/osmo-bsc/osmo_bsc_bssap.c
4 files changed, 22 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/90/27290/1
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 238b2f7..7657a5f 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -506,7 +506,24 @@
#define A38_XOR_MIN_KEY_LEN 12
#define A38_XOR_MAX_KEY_LEN 16
#define A38_COMP128_KEY_LEN 16
-#define RSL_ENC_ALG_A5(x) (x+1)
+
+/* There are these representations of A5/n:
+ *
+ * - (uint8_t)(1<<n), either as a single bit, or combined as a list of
+ * permitted algorithms.
+ * A5/0 == 0x01, A5/3 == 0x08, none = 0
+ *
+ * - n+1, used on the RSL wire.
+ * A5/0 == 1, A5/3 == 4, none = 0
+ *
+ * - n, used for human interaction and returned by select_best_cipher().
+ * A5/0 == 0, A5/3 == 3, none <= -1
+ *
+ * These macros convert from n to the other representations:
+ */
+#define ALG_A5_NR_TO_RSL(A5_N) ((A5_N) >= 0 ? (A5_N)+1 : 0)
+#define ALG_A5_NR_TO_PERM_ALG_BITS(A5_N) ((A5_N) >= 0 ? 1<<(A5_N) : 0)
+
/* Up to 16 SI2quater are multiplexed; each fits 3 EARFCNS, so the practical maximum is 3*16.
* The real maximum that fits in a total of 16 SI2quater rest octets also depends on the bits left by other SI2quater
* rest octets elements, so to really fit 48 EARFCNs most other SI2quater elements need to be omitted. */
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 402ea27..a49cc65 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -660,7 +660,7 @@
msg->l3h = len + 1;
*len = msgb_l3len(msg);
- if (lchan->encr.alg_id > RSL_ENC_ALG_A5(0)) {
+ if (lchan->encr.alg_id > ALG_A5_NR_TO_RSL(0)) {
uint8_t encr_info[MAX_A5_KEY_LEN+2];
rc = build_encr_info(encr_info, lchan);
if (rc > 0)
@@ -764,7 +764,7 @@
msgb_tlv_put(msg, RSL_IE_CHAN_MODE, sizeof(cm),
(uint8_t *) &cm);
- if (lchan->encr.alg_id > RSL_ENC_ALG_A5(0)) {
+ if (lchan->encr.alg_id > ALG_A5_NR_TO_RSL(0)) {
uint8_t encr_info[MAX_A5_KEY_LEN+2];
rc = build_encr_info(encr_info, lchan);
if (rc > 0)
diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c
index 6c0615e..03b1e98 100644
--- a/src/osmo-bsc/gsm_04_08_rr.c
+++ b/src/osmo-bsc/gsm_04_08_rr.c
@@ -374,7 +374,7 @@
DEBUGP(DRR, "TX CIPHERING MODE CMD\n");
- if (lchan->encr.alg_id <= RSL_ENC_ALG_A5(0))
+ if (lchan->encr.alg_id <= ALG_A5_NR_TO_RSL(0))
ciph_mod_set = 0;
else
ciph_mod_set = (lchan->encr.alg_id-2)<<1 | 1;
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 904da62..cf8254c 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -534,7 +534,7 @@
goto reject;
}
- conn->lchan->encr.alg_id = RSL_ENC_ALG_A5(chosen_cipher);
+ conn->lchan->encr.alg_id = ALG_A5_NR_TO_RSL(chosen_cipher);
if (enc_key_len) {
conn->lchan->encr.key_len = enc_key_len;
memcpy(conn->lchan->encr.key, enc_key, enc_key_len);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27290
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: 2021q4
Gerrit-Change-Id: I7557ae97764bba09c906748a18e9031dfb362611
Gerrit-Change-Number: 27290
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27289 )
Change subject: BSSGP_Emulation: usse alive-type for internal BVC created components
......................................................................
BSSGP_Emulation: usse alive-type for internal BVC created components
Otherwise, during shutdown of all components we may end up in a
situation where the BVC is already killed and BSSGP Emulation receives
a packet which tries to forward to BVC and fails.
This can be seen quite a lot in PCU_Tests.TC_pcuif_suspend:
"""
PCU_Tests.ttcn:394 setverdict(pass): none -> pass
...
PCUIF_Components.ttcn:246 Stopping test component execution.
...
GPRS_Components.ttcn:222 Connection of port BSSGP[0] to TC_pcuif_suspend-BVCI1234(6):BSSGP_SP was closed unexpectedly by the peer.
...
GPRS_Components.ttcn:222 Port BSSGP[0] was disconnected from TC_pcuif_suspend-BVCI1234(6):BSSGP_SP.
...
Component type BSSGP_Emulation.BSSGP_BVC_CT was shut down inside testcase TC_pcuif_suspend
...
BSSGP_Emulation.ttcnpp:317 Dynamic test case error: Sending data on the connection of port BVC to 6:BVC failed. (Broken pipe)
"""
Change-Id: Ib0adcf64eb5ca876cd9e9b91f2b597804c03bdc2
---
M library/BSSGP_Emulation.ttcnpp
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/89/27289/1
diff --git a/library/BSSGP_Emulation.ttcnpp b/library/BSSGP_Emulation.ttcnpp
index e0b5dee..1b628b3 100644
--- a/library/BSSGP_Emulation.ttcnpp
+++ b/library/BSSGP_Emulation.ttcnpp
@@ -198,7 +198,7 @@
var BssgpBvcConfig bvc_cfg := g_cfg.bvc[i];
var charstring bvc_id := id & "-BVCI" & int2str(bvc_cfg.bvci);
/* create, connect and start the BVC component */
- var BSSGP_BVC_CT bvc_ct := BSSGP_BVC_CT.create(bvc_id);
+ var BSSGP_BVC_CT bvc_ct := BSSGP_BVC_CT.create(bvc_id) alive;
connect(bvc_ct:BVC, self:BVC);
bvc_ct.start(f_bssgp_bvc_main(bvc_cfg, g_cfg.sgsn_role, g_cfg.nsei, bvc_id));
/* populate the BVC state table */
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27289
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib0adcf64eb5ca876cd9e9b91f2b597804c03bdc2
Gerrit-Change-Number: 27289
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27287 )
Change subject: pcu: Fix race condition in TC_t3141
......................................................................
pcu: Fix race condition in TC_t3141
The test was expecting to always receive at least 1 DL packet with
USF_UNUSED, but since we implemented idle blocks in PCUIF that may not
always be the case anymore. If the TBF is freed in between last
requested block and next one, there may be no TBF and hence no MS
listening on the TS, so PCU will optimize and send an idle block.
Change-Id: Ia301c01a3f5c3fd0b11d8f20e39061aa7abc6127
---
M pcu/PCU_Tests.ttcn
1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/87/27287/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27287
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia301c01a3f5c3fd0b11d8f20e39061aa7abc6127
Gerrit-Change-Number: 27287
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27287 )
Change subject: pcu: Fix race conditio in TC_t3141
......................................................................
pcu: Fix race conditio in TC_t3141
The test was expecting to always receive at least 1 DL packet with
USF_UNUSED, but since we implemented idle blocks in PCUIF that may not
always be the case anymore. If the TBF is freed in between last
requested block and next one, there may be no TBF and hence no MS
listening on the TS, so PCU will optimize and send an idle block.
Change-Id: Ia301c01a3f5c3fd0b11d8f20e39061aa7abc6127
---
M pcu/PCU_Tests.ttcn
1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/87/27287/1
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 7fcab4a..01113ab 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -1428,6 +1428,15 @@
block_nr := nr.blk_nr));
repeat;
}
+ [ul_tbf_usf_req] BTS.receive(tr_PCUIF_DATA_PDTCH(nr.bts_nr,
+ tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PDTCH),
+ omit)) {
+ /* TBF was dropped by T3141, and PCU answered with an IDLE block to
+ our last RTS.req because there's no longer any MS listening on
+ the TS. */
+ setverdict(pass);
+ break;
+ }
[] T_3141.timeout {
log("T_3141 expired but TBF is still active, unexpected");
f_shutdown(__BFILE__, __LINE__);
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27287
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia301c01a3f5c3fd0b11d8f20e39061aa7abc6127
Gerrit-Change-Number: 27287
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: fixeria, daniel.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27286 )
Change subject: msc: Avoid race condition when setting osmux options via VTY
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27286
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ife23f70c6523034f3c3c53b6c1c81428566fd43e
Gerrit-Change-Number: 27286
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 22 Feb 2022 13:35:48 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27286 )
Change subject: msc: Avoid race condition when setting osmux options via VTY
......................................................................
msc: Avoid race condition when setting osmux options via VTY
If the RAN_Emulation is started before the VTY reconfiguration we could
get a BSSMAP Reset/ResetAck with Osmux support advertised even though
the test expects it to be disabled (or vice versa).
Do the VTY configuration before starting the RAN_Emulation.
Fixes sporadic/load-related TTCN3 failures with message
"BSSMAP: Timeout waiting for RESET-ACK after sending RESET"
(e.g. TC_iu_and_mt_call_osmux, TC_iu_and_mo_sms in run +1567)
Change-Id: Ife23f70c6523034f3c3c53b6c1c81428566fd43e
---
M msc/MSC_Tests.ttcn
1 file changed, 24 insertions(+), 22 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/86/27286/1
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index db96d60..dd31daf 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -304,29 +304,7 @@
testcase.stop("excess number of BSC instances requested");
}
- for (var integer i := 0; i < num_bsc; i := i + 1) {
- if (isbound(mp_bssap_cfg[i])) {
- var RanOps ranops := BSC_RanOps;
- ranops.use_osmux := osmux;
- f_ran_adapter_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), ranops);
- f_ran_adapter_start(g_bssap[i]);
- } else {
- testcase.stop("missing BSSAP configuration");
- }
- }
-
f_ipa_ctrl_start_client(mp_msc_ip, mp_msc_ctrl_port);
- f_init_mncc("MSC_Test");
- f_init_mgcp("MSC_Test");
-
- if (gsup == true) {
- f_init_gsup("MSC_Test");
- }
- f_init_smpp("MSC_Test");
-
- if (sgsap == true) {
- f_init_sgsap("MSC_Test");
- }
map(self:MSCVTY, system:MSCVTY);
f_vty_set_prompts(MSCVTY);
@@ -344,6 +322,30 @@
} else {
f_vty_config(MSCVTY, "msc", "osmux off");
}
+
+ for (var integer i := 0; i < num_bsc; i := i + 1) {
+ if (isbound(mp_bssap_cfg[i])) {
+ var RanOps ranops := BSC_RanOps;
+ ranops.use_osmux := osmux;
+ f_ran_adapter_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), ranops);
+ f_ran_adapter_start(g_bssap[i]);
+ } else {
+ testcase.stop("missing BSSAP configuration");
+ }
+ }
+
+ f_init_mncc("MSC_Test");
+ f_init_mgcp("MSC_Test");
+
+ if (gsup == true) {
+ f_init_gsup("MSC_Test");
+ }
+ f_init_smpp("MSC_Test");
+
+ if (sgsap == true) {
+ f_init_sgsap("MSC_Test");
+ }
+
}
/* Initialize for a direct connection to BSSAP. This function is an alternative
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27286
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ife23f70c6523034f3c3c53b6c1c81428566fd43e
Gerrit-Change-Number: 27286
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: newchange
laforge has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/27283 )
Change subject: ttcn3-fr-test/jenkins.sh: revert docker run --rm
......................................................................
ttcn3-fr-test/jenkins.sh: revert docker run --rm
Revert the change of adding a --rm to the "docker run" commands done in
I48b01c43fedf379b8a565eaab0369806d7831bd8.
This script runs the containers in the background, waits until they are
done, copies the logs and then removes them afterwards.
Fix for:
+ docker kill jenkins-ttcn3-fr-test-384-frnet
jenkins-ttcn3-fr-test-384-frnet
+ docker logs --timestamps jenkins-ttcn3-fr-test-384-ttcn3-fr-test
Error: No such container: jenkins-ttcn3-fr-test-384-ttcn3-fr-test
Change-Id: I56dc07820ccfa8ad6936764262a7c6c272e59c37
---
M ttcn3-fr-test/jenkins.sh
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/ttcn3-fr-test/jenkins.sh b/ttcn3-fr-test/jenkins.sh
index 34aa740..4531e3a 100755
--- a/ttcn3-fr-test/jenkins.sh
+++ b/ttcn3-fr-test/jenkins.sh
@@ -25,7 +25,7 @@
echo Starting container with FRNET
docker run \
- --rm \
+ `# --rm is done in below` \
--cap-add=NET_RAW --cap-add=SYS_RAWIO \
$(docker_network_params $SUBNET 10) \
--ulimit core=-1 \
@@ -45,7 +45,7 @@
echo Starting container with FR testsuite
docker run \
- --rm \
+ `# --rm is done in below` \
--cap-add=NET_RAW --cap-add=SYS_RAWIO \
$(docker_network_params $SUBNET 103) \
--ulimit core=-1 \
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/27283
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I56dc07820ccfa8ad6936764262a7c6c272e59c37
Gerrit-Change-Number: 27283
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/27284 )
Change subject: ttcn3-fr-test/jenkins.sh: make use of clean_up()
......................................................................
ttcn3-fr-test/jenkins.sh: make use of clean_up()
Move cleaning up logic to clean_up(), so it runs as part of the
clean_up_trap if any command in the previous code fails.
For example, if the first docker container started properly, but the
second docker container failed to start: without this patch, it would
just stop the script without running the clean up code.
Change-Id: I4624e37d5d2fa90b71b32d72067b3645f69805da
---
M ttcn3-fr-test/jenkins.sh
1 file changed, 12 insertions(+), 9 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/ttcn3-fr-test/jenkins.sh b/ttcn3-fr-test/jenkins.sh
index 4531e3a..182f512 100755
--- a/ttcn3-fr-test/jenkins.sh
+++ b/ttcn3-fr-test/jenkins.sh
@@ -8,6 +8,16 @@
set_clean_up_trap
set -e
+clean_up() {
+ # kill the frnet container to avoid "You cannot remove a running container " below in 'rm'
+ docker kill ${BUILD_TAG}-frnet || true
+
+ # store execution logs for both containers
+ docker logs --timestamps ${BUILD_TAG}-ttcn3-fr-test > $VOL_BASE_DIR/fr-tester/exec.log || true
+ docker logs --timestamps ${BUILD_TAG}-frnet > $VOL_BASE_DIR/frnet/exec.log || true
+ docker container rm ${BUILD_TAG}-frnet ${BUILD_TAG}-ttcn3-fr-test
+}
+
SUBNET=26
network_create $SUBNET
@@ -25,7 +35,7 @@
echo Starting container with FRNET
docker run \
- `# --rm is done in below` \
+ `# --rm is done in clean_up()` \
--cap-add=NET_RAW --cap-add=SYS_RAWIO \
$(docker_network_params $SUBNET 10) \
--ulimit core=-1 \
@@ -45,7 +55,7 @@
echo Starting container with FR testsuite
docker run \
- `# --rm is done in below` \
+ `# --rm is done in clean_up()` \
--cap-add=NET_RAW --cap-add=SYS_RAWIO \
$(docker_network_params $SUBNET 103) \
--ulimit core=-1 \
@@ -66,10 +76,3 @@
# emulate running container in foreground, which is no longer possible as we
# must shift the net-devices into the container _after_ it is started
docker logs -f ${BUILD_TAG}-ttcn3-fr-test
-# kill the frnet container to avoid "You cannot remove a running container " below in 'rm'
-docker kill ${BUILD_TAG}-frnet
-
-# store execution logs for both containers
-docker logs --timestamps ${BUILD_TAG}-ttcn3-fr-test > $VOL_BASE_DIR/fr-tester/exec.log
-docker logs --timestamps ${BUILD_TAG}-frnet > $VOL_BASE_DIR/frnet/exec.log
-docker container rm ${BUILD_TAG}-frnet ${BUILD_TAG}-ttcn3-fr-test
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/27284
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I4624e37d5d2fa90b71b32d72067b3645f69805da
Gerrit-Change-Number: 27284
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: osmith.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/27284 )
Change subject: ttcn3-fr-test/jenkins.sh: make use of clean_up()
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/27284
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I4624e37d5d2fa90b71b32d72067b3645f69805da
Gerrit-Change-Number: 27284
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 22 Feb 2022 11:56:05 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/27285 )
Change subject: jobs/ttcn3-testsuites.yml: add ttcn3-fr-test
......................................................................
jobs/ttcn3-testsuites.yml: add ttcn3-fr-test
Add a configuration for the job to the yml file. It looks like this job
was created manually, or the configuration was just not pushed to
gerrit.
This makes e-mail notifications consistent and fixes missing colors in
build output.
Change-Id: I14995dea0a0d223b78e20b49953d5c814c1ad4a1
---
M jobs/ttcn3-testsuites.yml
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/jobs/ttcn3-testsuites.yml b/jobs/ttcn3-testsuites.yml
index dbf162b..5b915c7 100644
--- a/jobs/ttcn3-testsuites.yml
+++ b/jobs/ttcn3-testsuites.yml
@@ -151,6 +151,10 @@
blocking: "^(ttcn3|TTCN3-.*)-hnbgw-test.*"
timer: 40 13 * * *
disabled: true
+ - ttcn3-fr-test:
+ blocking: "^(ttcn3|TTCN3-.*)-fr-test.*"
+ timer: 40 10 * * *
+ node: hdlc
# debian-stretch latest stable
- nplab-m3ua-test-latest:
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/27285
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I14995dea0a0d223b78e20b49953d5c814c1ad4a1
Gerrit-Change-Number: 27285
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/dahdi-linux/+/27264 )
Change subject: enable PPP and DAHDI_MIRROR by default.
......................................................................
enable PPP and DAHDI_MIRROR by default.
There's not really any reason to disable those, from what I can tell.
Change-Id: Ib03074062ada7b6da485afac53b1550d31f1a5ca
---
M include/dahdi/dahdi_config.h
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
tnt: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/include/dahdi/dahdi_config.h b/include/dahdi/dahdi_config.h
index 0a8f5a9..c441b62 100644
--- a/include/dahdi/dahdi_config.h
+++ b/include/dahdi/dahdi_config.h
@@ -80,6 +80,7 @@
* support.
*/
#define CONFIG_DAHDI_NET
+#define CONFIG_DAHDI_PPP
/*
* Uncomment for Generic PPP support (i.e. DAHDIRAS)
@@ -187,7 +188,7 @@
/*
* Creates an interface for mirroring the raw channel data out to a pseudo-chan
*/
-/* #define CONFIG_DAHDI_MIRROR */
+#define CONFIG_DAHDI_MIRROR
/*
* Adds support for conference links. There are some non-Asterisk users of this
--
To view, visit https://gerrit.osmocom.org/c/dahdi-linux/+/27264
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: dahdi-linux
Gerrit-Branch: master
Gerrit-Change-Id: Ib03074062ada7b6da485afac53b1550d31f1a5ca
Gerrit-Change-Number: 27264
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: tnt <tnt(a)246tNt.com>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27250 )
Change subject: cosmetics around select_best_cipher()
......................................................................
cosmetics around select_best_cipher()
Improve the function doc. Remove a comment at a caller, because that
information is what the function doc is for.
Rename the array to codec_by_strength, because it is not the codec
strength but the codec number listed in the array.
Related: SYS#5839
Change-Id: Iaed6b97c31e4ccb1f28ca7e64596d5e20563b392
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 5 insertions(+), 7 deletions(-)
Approvals:
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 8acf293..cab78ed 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -393,17 +393,18 @@
return 0;
}
-/* select the best cipher permitted by the intersection of both masks */
+/* Select the best cipher permitted by the intersection of both masks. Return as the n in A5/n, or -1 if the
+ * intersection is empty. */
int select_best_cipher(uint8_t msc_mask, uint8_t bsc_mask)
{
/* A5/7 ... A5/3: We assume higher is better,
* but: A5/1 is better than A5/2, which is better than A5/0 */
- const uint8_t codec_strength[8] = { 7, 6, 5, 4, 3, 1, 2, 0 };
+ const uint8_t codec_by_strength[8] = { 7, 6, 5, 4, 3, 1, 2, 0 };
uint8_t intersection = msc_mask & bsc_mask;
int i;
- for (i = 0; i < ARRAY_SIZE(codec_strength); i++) {
- uint8_t codec = codec_strength[i];
+ for (i = 0; i < ARRAY_SIZE(codec_by_strength); i++) {
+ uint8_t codec = codec_by_strength[i];
if (intersection & (1 << codec))
return codec;
}
@@ -509,9 +510,6 @@
* a5_encryption == 2 --> 0x04 ... */
enc_bits_msc = data[0];
- /* The bit-mask of permitted ciphers from the MSC (sent in ASSIGNMENT COMMAND) is intersected
- * with the vty-configured mask a the BSC. Finally, the best (highest) possible cipher is
- * chosen. */
chosen_cipher = select_best_cipher(enc_bits_msc, bsc_gsmnet->a5_encryption_mask);
if (chosen_cipher < 0) {
LOGP(DMSC, LOGL_ERROR, "Reject: no overlapping A5 ciphers between BSC (0x%02x) "
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27250
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iaed6b97c31e4ccb1f28ca7e64596d5e20563b392
Gerrit-Change-Number: 27250
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27249 )
Change subject: fix inter-BSC-in handover encryption
......................................................................
fix inter-BSC-in handover encryption
In the field we saw Handover Requests without any Chosen Encryption
Algorithm IE, and osmo-bsc completely failed on those. This made me
understand my mistake from when I wrote this handover code.
So far, from a BSSMAP Handover Request, we (I) used only the Chosen
Encryption Algorithm IE to pick the encryption to use on the target
lchan. That is very wrong.
Instead, figure out the intersection of permitted algorithms MSC & BSC,
and pick the best of those. Which means, actually, completely ignore the
Chosen Encryption Algorithm IE.
In the message, the permitted algorithms are passed as a bitmask. The
current code using gsm0808_dec_encrypt_info() passes this on as an
array. In order to select_best_cipher(), I could convert that array back
to a bitmask. Instead pass the bitmask on from message decoding
alongside the struct gsm0808_encrypt_info in req->ei_as_bitmask.
In handover_end(), change the condition so that we can also pass
HO_RESULT_FAIL_RR_HO_FAIL to emit a Handover Failure.
Related: SYS#5839
Change-Id: Iffedc981b60d309ed2e5decd5efedee07a757b53
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/handover_fsm.c
M src/osmo-bsc/osmo_bsc_bssap.c
3 files changed, 26 insertions(+), 8 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 07d141d..4fe97a2 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -270,6 +270,8 @@
struct gsm0808_channel_type ct;
struct gsm0808_speech_codec_list scl;
struct gsm0808_encrypt_info ei;
+ /* The same information as in 'ei' but as the handy bitmask as on the wire. */
+ uint8_t ei_as_bitmask;
bool kc128_present;
uint8_t kc128[16];
struct gsm_classmark classmark;
@@ -1457,4 +1459,6 @@
enum rsl_cmod_spd chan_mode_to_rsl_cmod_spd(enum gsm48_chan_mode chan_mode);
+int select_best_cipher(uint8_t msc_mask, uint8_t bsc_mask);
+
#endif /* _GSM_DATA_H */
diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index 37e7417..487135b 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -490,6 +490,7 @@
LOG_HO(conn, LOGL_ERROR, "Failed to parse Encryption Information IE\n");
return false;
}
+ req->ei_as_bitmask = *e->val;
if ((e = TLVP_GET(tp, GSM0808_IE_KC_128))) {
if (e->len != 16) {
@@ -630,6 +631,7 @@
int match_idx;
struct osmo_fsm_inst *fi;
struct channel_mode_and_rate ch_mode_rate = {};
+ int chosen_a5_n;
handover_fsm_alloc(conn);
@@ -717,16 +719,28 @@
.msc_assigned_cic = req->msc_assigned_cic,
};
- if (req->chosen_encr_alg) {
- info.encr.alg_id = req->chosen_encr_alg;
- if (info.encr.alg_id > 1 && !req->ei.key_len) {
- ho_fail(HO_RESULT_ERROR, "Chosen Encryption Algorithm (Serving) reflects A5/%u"
- " but there is no key (Encryption Information)", info.encr.alg_id - 1);
+ /* Figure out the encryption algorithm */
+ chosen_a5_n = select_best_cipher(req->ei_as_bitmask, bsc_gsmnet->a5_encryption_mask);
+ if (chosen_a5_n < 0) {
+ ho_fail(HO_RESULT_FAIL_RR_HO_FAIL,
+ "There is no A5 encryption mode that both BSC and MSC permit: MSC 0x%x & BSC 0x%x = 0\n",
+ req->ei_as_bitmask, bsc_gsmnet->a5_encryption_mask);
+ return;
+ }
+ if (chosen_a5_n > 0 && !req->ei.key_len) {
+ /* There is no key. Is A5/0 permitted? */
+ if ((req->ei_as_bitmask & bsc_gsmnet->a5_encryption_mask & 0x1) == 0x1) {
+ chosen_a5_n = 0;
+ } else {
+ ho_fail(HO_RESULT_ERROR,
+ "Encryption is required, but there is no key (Encryption Information)");
return;
}
}
- if (req->ei.key_len) {
+ /* Put encryption info in the chan activation info */
+ info.encr.alg_id = ALG_A5_NR_TO_RSL(chosen_a5_n);
+ if (chosen_a5_n > 0) {
if (req->ei.key_len > sizeof(info.encr.key)) {
ho_fail(HO_RESULT_ERROR, "Encryption Information IE key length is too large: %u\n",
req->ei.key_len);
@@ -965,7 +979,7 @@
result = bsc_tx_bssmap_ho_complete(conn, ho->new_lchan);
}
/* Not 'else': above checks may still result in HO_RESULT_ERROR. */
- if (result == HO_RESULT_ERROR) {
+ if (result != HO_RESULT_OK) {
/* Return a BSSMAP Handover Failure, as described in 3GPP TS 48.008 3.1.5.2.2
* "Handover Resource Allocation Failure" */
bsc_tx_bssmap_ho_failure(conn);
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index b18627c..8acf293 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -394,7 +394,7 @@
}
/* select the best cipher permitted by the intersection of both masks */
-static int select_best_cipher(uint8_t msc_mask, uint8_t bsc_mask)
+int select_best_cipher(uint8_t msc_mask, uint8_t bsc_mask)
{
/* A5/7 ... A5/3: We assume higher is better,
* but: A5/1 is better than A5/2, which is better than A5/0 */
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27249
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iffedc981b60d309ed2e5decd5efedee07a757b53
Gerrit-Change-Number: 27249
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: osmith.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/27284 )
Change subject: ttcn3-fr-test/jenkins.sh: make use of clean_up()
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/27284
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I4624e37d5d2fa90b71b32d72067b3645f69805da
Gerrit-Change-Number: 27284
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 22 Feb 2022 11:39:18 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/27285 )
Change subject: jobs/ttcn3-testsuites.yml: add ttcn3-fr-test
......................................................................
jobs/ttcn3-testsuites.yml: add ttcn3-fr-test
Add a configuration for the job to the yml file. It looks like this job
was created manually, or the configuration was just not pushed to
gerrit.
This makes e-mail notifications consistent and fixes missing colors in
build output.
Change-Id: I14995dea0a0d223b78e20b49953d5c814c1ad4a1
---
M jobs/ttcn3-testsuites.yml
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/85/27285/1
diff --git a/jobs/ttcn3-testsuites.yml b/jobs/ttcn3-testsuites.yml
index dbf162b..5b915c7 100644
--- a/jobs/ttcn3-testsuites.yml
+++ b/jobs/ttcn3-testsuites.yml
@@ -151,6 +151,10 @@
blocking: "^(ttcn3|TTCN3-.*)-hnbgw-test.*"
timer: 40 13 * * *
disabled: true
+ - ttcn3-fr-test:
+ blocking: "^(ttcn3|TTCN3-.*)-fr-test.*"
+ timer: 40 10 * * *
+ node: hdlc
# debian-stretch latest stable
- nplab-m3ua-test-latest:
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/27285
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I14995dea0a0d223b78e20b49953d5c814c1ad4a1
Gerrit-Change-Number: 27285
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/docker-playground/+/27283 )
Change subject: ttcn3-fr-test/jenkins.sh: revert docker run --rm
......................................................................
ttcn3-fr-test/jenkins.sh: revert docker run --rm
Revert the change of adding a --rm to the "docker run" commands done in
I48b01c43fedf379b8a565eaab0369806d7831bd8.
This script runs the containers in the background, waits until they are
done, copies the logs and then removes them afterwards.
Fix for:
+ docker kill jenkins-ttcn3-fr-test-384-frnet
jenkins-ttcn3-fr-test-384-frnet
+ docker logs --timestamps jenkins-ttcn3-fr-test-384-ttcn3-fr-test
Error: No such container: jenkins-ttcn3-fr-test-384-ttcn3-fr-test
Change-Id: I56dc07820ccfa8ad6936764262a7c6c272e59c37
---
M ttcn3-fr-test/jenkins.sh
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/83/27283/1
diff --git a/ttcn3-fr-test/jenkins.sh b/ttcn3-fr-test/jenkins.sh
index 34aa740..4531e3a 100755
--- a/ttcn3-fr-test/jenkins.sh
+++ b/ttcn3-fr-test/jenkins.sh
@@ -25,7 +25,7 @@
echo Starting container with FRNET
docker run \
- --rm \
+ `# --rm is done in below` \
--cap-add=NET_RAW --cap-add=SYS_RAWIO \
$(docker_network_params $SUBNET 10) \
--ulimit core=-1 \
@@ -45,7 +45,7 @@
echo Starting container with FR testsuite
docker run \
- --rm \
+ `# --rm is done in below` \
--cap-add=NET_RAW --cap-add=SYS_RAWIO \
$(docker_network_params $SUBNET 103) \
--ulimit core=-1 \
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/27283
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I56dc07820ccfa8ad6936764262a7c6c272e59c37
Gerrit-Change-Number: 27283
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/docker-playground/+/27284 )
Change subject: ttcn3-fr-test/jenkins.sh: make use of clean_up()
......................................................................
ttcn3-fr-test/jenkins.sh: make use of clean_up()
Move cleaning up logic to clean_up(), so it runs as part of the
clean_up_trap if any command in the previous code fails.
For example, if the first docker container started properly, but the
second docker container failed to start: without this patch, it would
just stop the script without running the clean up code.
Change-Id: I4624e37d5d2fa90b71b32d72067b3645f69805da
---
M ttcn3-fr-test/jenkins.sh
1 file changed, 12 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/84/27284/1
diff --git a/ttcn3-fr-test/jenkins.sh b/ttcn3-fr-test/jenkins.sh
index 4531e3a..182f512 100755
--- a/ttcn3-fr-test/jenkins.sh
+++ b/ttcn3-fr-test/jenkins.sh
@@ -8,6 +8,16 @@
set_clean_up_trap
set -e
+clean_up() {
+ # kill the frnet container to avoid "You cannot remove a running container " below in 'rm'
+ docker kill ${BUILD_TAG}-frnet || true
+
+ # store execution logs for both containers
+ docker logs --timestamps ${BUILD_TAG}-ttcn3-fr-test > $VOL_BASE_DIR/fr-tester/exec.log || true
+ docker logs --timestamps ${BUILD_TAG}-frnet > $VOL_BASE_DIR/frnet/exec.log || true
+ docker container rm ${BUILD_TAG}-frnet ${BUILD_TAG}-ttcn3-fr-test
+}
+
SUBNET=26
network_create $SUBNET
@@ -25,7 +35,7 @@
echo Starting container with FRNET
docker run \
- `# --rm is done in below` \
+ `# --rm is done in clean_up()` \
--cap-add=NET_RAW --cap-add=SYS_RAWIO \
$(docker_network_params $SUBNET 10) \
--ulimit core=-1 \
@@ -45,7 +55,7 @@
echo Starting container with FR testsuite
docker run \
- `# --rm is done in below` \
+ `# --rm is done in clean_up()` \
--cap-add=NET_RAW --cap-add=SYS_RAWIO \
$(docker_network_params $SUBNET 103) \
--ulimit core=-1 \
@@ -66,10 +76,3 @@
# emulate running container in foreground, which is no longer possible as we
# must shift the net-devices into the container _after_ it is started
docker logs -f ${BUILD_TAG}-ttcn3-fr-test
-# kill the frnet container to avoid "You cannot remove a running container " below in 'rm'
-docker kill ${BUILD_TAG}-frnet
-
-# store execution logs for both containers
-docker logs --timestamps ${BUILD_TAG}-ttcn3-fr-test > $VOL_BASE_DIR/fr-tester/exec.log
-docker logs --timestamps ${BUILD_TAG}-frnet > $VOL_BASE_DIR/frnet/exec.log
-docker container rm ${BUILD_TAG}-frnet ${BUILD_TAG}-ttcn3-fr-test
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/27284
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I4624e37d5d2fa90b71b32d72067b3645f69805da
Gerrit-Change-Number: 27284
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27248 )
Change subject: rename RSL_ENC_ALG_A5 to ALG_A5_NR_TO_RSL, clarify
......................................................................
rename RSL_ENC_ALG_A5 to ALG_A5_NR_TO_RSL, clarify
The naming confused me so that I wrote buggy code again. Hopefully this
clarifies which representations the code paths are using.
In the macro code, highlight the error case of n <= -1 explicitly.
Also add ALG_A5_NR_TO_PERM_ALG_BITS. I need the 1<<n case in an
upcoming patch.
Related: SYS#5839
Change-Id: I7557ae97764bba09c906748a18e9031dfb362611
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/gsm_04_08_rr.c
M src/osmo-bsc/osmo_bsc_bssap.c
4 files changed, 22 insertions(+), 5 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 910c3d3..07d141d 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -528,7 +528,24 @@
#define A38_XOR_MIN_KEY_LEN 12
#define A38_XOR_MAX_KEY_LEN 16
#define A38_COMP128_KEY_LEN 16
-#define RSL_ENC_ALG_A5(x) (x+1)
+
+/* There are these representations of A5/n:
+ *
+ * - (uint8_t)(1<<n), either as a single bit, or combined as a list of
+ * permitted algorithms.
+ * A5/0 == 0x01, A5/3 == 0x08, none = 0
+ *
+ * - n+1, used on the RSL wire.
+ * A5/0 == 1, A5/3 == 4, none = 0
+ *
+ * - n, used for human interaction and returned by select_best_cipher().
+ * A5/0 == 0, A5/3 == 3, none <= -1
+ *
+ * These macros convert from n to the other representations:
+ */
+#define ALG_A5_NR_TO_RSL(A5_N) ((A5_N) >= 0 ? (A5_N)+1 : 0)
+#define ALG_A5_NR_TO_PERM_ALG_BITS(A5_N) ((A5_N) >= 0 ? 1<<(A5_N) : 0)
+
/* Up to 16 SI2quater are multiplexed; each fits 3 EARFCNS, so the practical maximum is 3*16.
* The real maximum that fits in a total of 16 SI2quater rest octets also depends on the bits left by other SI2quater
* rest octets elements, so to really fit 48 EARFCNs most other SI2quater elements need to be omitted. */
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 402ea27..a49cc65 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -660,7 +660,7 @@
msg->l3h = len + 1;
*len = msgb_l3len(msg);
- if (lchan->encr.alg_id > RSL_ENC_ALG_A5(0)) {
+ if (lchan->encr.alg_id > ALG_A5_NR_TO_RSL(0)) {
uint8_t encr_info[MAX_A5_KEY_LEN+2];
rc = build_encr_info(encr_info, lchan);
if (rc > 0)
@@ -764,7 +764,7 @@
msgb_tlv_put(msg, RSL_IE_CHAN_MODE, sizeof(cm),
(uint8_t *) &cm);
- if (lchan->encr.alg_id > RSL_ENC_ALG_A5(0)) {
+ if (lchan->encr.alg_id > ALG_A5_NR_TO_RSL(0)) {
uint8_t encr_info[MAX_A5_KEY_LEN+2];
rc = build_encr_info(encr_info, lchan);
if (rc > 0)
diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c
index 6c0615e..03b1e98 100644
--- a/src/osmo-bsc/gsm_04_08_rr.c
+++ b/src/osmo-bsc/gsm_04_08_rr.c
@@ -374,7 +374,7 @@
DEBUGP(DRR, "TX CIPHERING MODE CMD\n");
- if (lchan->encr.alg_id <= RSL_ENC_ALG_A5(0))
+ if (lchan->encr.alg_id <= ALG_A5_NR_TO_RSL(0))
ciph_mod_set = 0;
else
ciph_mod_set = (lchan->encr.alg_id-2)<<1 | 1;
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 3f56052..b18627c 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -534,7 +534,7 @@
goto reject;
}
- conn->lchan->encr.alg_id = RSL_ENC_ALG_A5(chosen_cipher);
+ conn->lchan->encr.alg_id = ALG_A5_NR_TO_RSL(chosen_cipher);
if (enc_key_len) {
conn->lchan->encr.key_len = enc_key_len;
memcpy(conn->lchan->encr.key, enc_key, enc_key_len);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27248
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7557ae97764bba09c906748a18e9031dfb362611
Gerrit-Change-Number: 27248
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27270 )
Change subject: GTP_Codec_Port: Check length field of GTPV1C received packets
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27270
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie9447b7ec7f7f5ee35cd0393265f5edb5578bdaf
Gerrit-Change-Number: 27270
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 22 Feb 2022 07:40:31 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment