[MERGED] osmo-bts[master]: rsl: log errors when parsing of encryption information fails

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed May 9 18:42:10 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: rsl: log errors when parsing of  encryption information fails
......................................................................


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
---
M src/common/rsl.c
1 file changed, 10 insertions(+), 2 deletions(-)

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



diff --git a/src/common/rsl.c b/src/common/rsl.c
index 8a1a232..229d960 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -868,18 +868,26 @@
 
 	/* 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;
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icda7722eef319f343178b0bb8f79362026948199
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list