aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-05-09 20:00:47 +0200
committerHarald Welte <laforge@gnumonks.org>2018-05-09 18:42:09 +0000
commit09e49eed6181cea145cd08c65c87986a6e033be9 (patch)
treeab7333f9b4848c04f339a9f0630f6b949e03e2b7 /src
parent2f54c5f29799f7adc6a9808431ca47dba808b984 (diff)
rsl: log errors when parsing of encryption information fails
... also log a DEBUG message whenever we change the lchan->encr Related: OS#3254 Change-Id: Icda7722eef319f343178b0bb8f79362026948199
Diffstat (limited to 'src')
-rw-r--r--src/common/rsl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 8a1a232f..229d960c 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -868,18 +868,26 @@ static int encr_info2lchan(struct gsm_lchan *lchan,
/* check if the encryption algorithm sent by BSC is supported! */
rc = bts_supports_cipher(bts, *val);
- if (rc != 1)
+ if (rc != 1) {
+ LOGP(DRSL, LOGL_ERROR, "%s: BTS doesn't support cipher 0x%02x\n",
+ gsm_lchan_name(lchan), *val);
return rc;
+ }
/* length can be '1' in case of no ciphering */
- if (len < 1)
+ if (len < 1) {
+ LOGP(DRSL, LOGL_ERROR, "%s: Encryption Info cannot have len=%d\n",
+ gsm_lchan_name(lchan), len);
return -EINVAL;
+ }
lchan->encr.alg_id = *val++;
lchan->encr.key_len = len -1;
if (lchan->encr.key_len > sizeof(lchan->encr.key))
lchan->encr.key_len = sizeof(lchan->encr.key);
memcpy(lchan->encr.key, val, lchan->encr.key_len);
+ DEBUGP(DRSL, "%s: Setting lchan cipher algorithm 0x%02x\n",
+ gsm_lchan_name(lchan), lchan->encr.alg_id);
return 0;
}