TRX: If no cipher algorithm is given, or if it is a5/0, reset cipher state

This commit is contained in:
Andreas Eversberg 2013-06-20 20:10:46 +02:00 committed by Harald Welte
parent 8c8998e551
commit f5aaf523c5
1 changed files with 4 additions and 1 deletions

View File

@ -2573,7 +2573,10 @@ int trx_sched_set_cipher(struct trx_l1h *l1h, uint8_t chan_nr, int downlink,
int rc = -EINVAL;
struct trx_chan_state *chan_state;
if (algo < 0 || key_len > 8 || (algo && key_len != 8)) {
/* no algorithm given means a5/0 */
if (algo <= 0)
algo = 0;
else if (key_len != 8) {
LOGP(DL1C, LOGL_ERROR, "Algo A5/%d not supported with given "
"key len=%d\n", algo, key_len);
return -ENOTSUP;