diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 12712db55..9b6f8b117 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -718,7 +718,7 @@ runs on MSC_ConnHdlr { 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 @@ runs on MSC_ConnHdlr { 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; }