aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_04_08.c
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2010-11-29 08:19:04 +0100
committerSylvain Munaut <tnt@246tNt.com>2010-12-01 20:36:34 +0100
commit67706df7c210c8cf0995d2d7ecd0293f6bdaab0b (patch)
tree4098c10f1b0c284e139c01c08cbd43f5dd5269c9 /openbsc/src/gsm_04_08.c
parente0b06b0293c9998dcdb108333f2a3a05966e5ea0 (diff)
gsm_04_08: Don't set ciphering manually but call gsm0808_cipher_mode
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'openbsc/src/gsm_04_08.c')
-rw-r--r--openbsc/src/gsm_04_08.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index 5a76baa9c..b3c5a98c0 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -196,11 +196,8 @@ static int gsm48_secure_channel(struct gsm_subscriber_connection *conn, int key_
return gsm48_tx_mm_auth_req(conn, op->atuple.rand, op->atuple.key_seq);
} else if (rc == 2) {
/* Start ciphering directly */
- conn->lchan->encr.alg_id = RSL_ENC_ALG_A5(net->a5_encryption);
- conn->lchan->encr.key_len = 8;
- memcpy(conn->lchan->encr.key, op->atuple.kc, 8);
-
- return gsm48_send_rr_ciph_mode(conn->lchan, 0);
+ return gsm0808_cipher_mode(conn, net->a5_encryption,
+ op->atuple.kc, 8, 0);
}
return -EINVAL; /* not reached */
@@ -943,11 +940,8 @@ static int gsm48_rx_mm_auth_resp(struct gsm_subscriber_connection *conn, struct
DEBUGPC(DMM, "OK\n");
/* Start ciphering */
- conn->lchan->encr.alg_id = RSL_ENC_ALG_A5(net->a5_encryption);
- conn->lchan->encr.key_len = 8;
- memcpy(conn->lchan->encr.key, conn->sec_operation->atuple.kc, 8);
-
- return gsm48_send_rr_ciph_mode(msg->lchan, 0);
+ return gsm0808_cipher_mode(conn, net->a5_encryption,
+ conn->sec_operation->atuple.kc, 8, 0);
}
/* Receive a GSM 04.08 Mobility Management (MM) message */