Change in osmo-ttcn3-hacks[master]: bsc: also allow empty key for A5/0

laforge gerrit-no-reply at
Mon Jun 21 20:18:35 UTC 2021

laforge has submitted this change. ( )

Change subject: bsc: also allow empty key for A5/0

bsc: also allow empty key for A5/0

Change-Id: Id54abc09dd62d7247a970a03ed8c2209b641f511
M bsc/MSC_ConnectionHandler.ttcn
1 file changed, 8 insertions(+), 1 deletion(-)

  neels: Looks good to me, approved
  dexter: Looks good to me, but someone else must approve
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 12712db..9b6f8b1 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -718,7 +718,7 @@
 	var PDU_BSSAP bssap;
 	var RSL_Message rsl;
 	var RSL_AlgId alg_rsl;
-	var octetstring expect_kc;
+	var template octetstring expect_kc;
 	if (isvalue(enc.enc_kc128)) {
 		BSSAP.send(ts_BSSMAP_CipherModeCmdKc128(enc.enc_alg, enc.enc_key, valueof(enc.enc_kc128)));
@@ -732,6 +732,13 @@
 	if (alg_rsl == RSL_ALG_ID_A5_4 and ispresent(enc.enc_kc128)) {
 		expect_kc := enc.enc_kc128;
+	} else if (alg_rsl == RSL_ALG_ID_A5_0) {
+		/* When A5/0 is chosen, no encryption is active, so technically, no key is needed. However, 3GPP TS
+		 * 48.058 9.3.7 Encryption Information stays quite silent about presence or absence of a key for A5/0.
+		 * The only thing specified is how to indicate the length of the key; the possibility that the key may
+		 * be zero length is not explicitly mentioned. So it seems that we should always send the key along,
+		 * even for A5/0. Still, let's also allow a zero length key for A5/0. */
+		expect_kc := (enc.enc_key, ''O);
 	} else {
 		expect_kc := enc.enc_key;

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id54abc09dd62d7247a970a03ed8c2209b641f511
Gerrit-Change-Number: 24732
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at>
Gerrit-Reviewer: laforge <laforge at>
Gerrit-Reviewer: neels <nhofmeyr at>
Gerrit-Reviewer: pespin <pespin at>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list