aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-08-30 15:37:11 +0900
committerHarald Welte <laforge@gnumonks.org>2009-08-30 15:37:11 +0900
commit08d91a5b26f0a81d6c5ba6f2c03a465108a3f189 (patch)
treea4405408aa97d963d7732a21b9d7cd1abe927348 /openbsc/include/openbsc
parent196d0528ff8a4a887168efe436ddf059e5b9561e (diff)
A5 support for RSL and 04.08 (not used yet)
This just adds the 04.08 and RSL bits for A5, but not the logic for performing authentication. The caller would first set lchan->encr and then call gsm48_send_rr_ciph_mode(lchan), which encapsulates the 04.08 CIPHERING MODE COMMAND into a RSL ENCRYPTION COMMAND and sends it to the BTS for execution + forwarding.
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r--openbsc/include/openbsc/abis_rsl.h1
-rw-r--r--openbsc/include/openbsc/gsm_04_08.h1
-rw-r--r--openbsc/include/openbsc/gsm_data.h9
3 files changed, 11 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h
index 6a454bf4e..8c5547d1d 100644
--- a/openbsc/include/openbsc/abis_rsl.h
+++ b/openbsc/include/openbsc/abis_rsl.h
@@ -499,6 +499,7 @@ int rsl_chan_activate(struct gsm_bts_trx *trx, u_int8_t chan_nr,
int rsl_chan_activate_lchan(struct gsm_lchan *lchan, u_int8_t act_type,
u_int8_t ta);
int rsl_chan_mode_modify_req(struct gsm_lchan *ts);
+int rsl_encryption_cmd(struct msgb *msg);
int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len,
u_int8_t *ms_ident, u_int8_t chan_needed);
int rsl_paging_cmd_subscr(struct gsm_bts *bts, u_int8_t chan_needed,
diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h
index 6f367864f..99d774770 100644
--- a/openbsc/include/openbsc/gsm_04_08.h
+++ b/openbsc/include/openbsc/gsm_04_08.h
@@ -713,6 +713,7 @@ int gsm48_generate_mid_from_imsi(u_int8_t *buf, const char* imsi);
int gsm48_mi_to_string(char *string, const int str_len, const u_int8_t *mi, const int mi_len);
int gsm48_send_rr_release(struct gsm_lchan *lchan);
+int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan);
int gsm48_send_rr_app_info(struct gsm_lchan *lchan, u_int8_t apdu_id,
u_int8_t apdu_len, u_int8_t *apdu);
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 4bdca2ab7..2658a79a4 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -126,6 +126,9 @@ struct gsm_loc_updating_operation {
int waiting_for_imei : 1;
};
+#define MAX_A5_KEY_LEN (128/8)
+#define RSL_ENC_ALG_A5(x) (x+1)
+
struct gsm_lchan {
/* The TS that we're part of */
struct gsm_bts_trx_ts *ts;
@@ -140,6 +143,12 @@ struct gsm_lchan {
/* Power levels for MS and BTS */
u_int8_t bs_power;
u_int8_t ms_power;
+ /* Encryption information */
+ struct {
+ u_int8_t alg_id;
+ u_int8_t key_len;
+ u_int8_t key[MAX_A5_KEY_LEN];
+ } encr;
/* To whom we are allocated at the moment */
struct gsm_subscriber *subscr;