update the HACK to delay the fake CIPHERING MODE COMPLETE
When seinding the fake CIPH MOD COMPL, we should wait a bit, as otherwise it will reach the MSC _before_ we ever get the (still unencrypted) CLASSMARK update from the MS.
This commit is contained in:
parent
0285067b63
commit
168238f9de
|
@ -26,6 +26,7 @@
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include <osmocom/core/msgb.h>
|
#include <osmocom/core/msgb.h>
|
||||||
|
#include <osmocom/core/talloc.h>
|
||||||
#include <osmocom/gsm/rsl.h>
|
#include <osmocom/gsm/rsl.h>
|
||||||
#include <osmocom/gsm/lapdm.h>
|
#include <osmocom/gsm/lapdm.h>
|
||||||
#include <osmocom/gsm/protocol/gsm_12_21.h>
|
#include <osmocom/gsm/protocol/gsm_12_21.h>
|
||||||
|
@ -683,8 +684,34 @@ static int tx_ciph_mod_compl_hack(struct gsm_lchan *lchan, uint8_t link_id,
|
||||||
/* send it back to the BTS */
|
/* send it back to the BTS */
|
||||||
return abis_rsl_sendmsg(fake_msg);
|
return abis_rsl_sendmsg(fake_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct ciph_mod_compl {
|
||||||
|
struct osmo_timer_list timer;
|
||||||
|
struct gsm_lchan *lchan;
|
||||||
|
int send_imeisv;
|
||||||
|
uint8_t link_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
static void cmc_timer_cb(void *data)
|
||||||
|
{
|
||||||
|
struct ciph_mod_compl *cmc = data;
|
||||||
|
const char *imeisv = NULL;
|
||||||
|
|
||||||
|
LOGP(DRSL, LOGL_NOTICE,
|
||||||
|
"%s Sending FAKE CIPHERING MODE COMPLETE to BSC (Alg %u)\n",
|
||||||
|
gsm_lchan_name(cmc->lchan), cmc->lchan->encr.alg_id);
|
||||||
|
|
||||||
|
if (cmc->send_imeisv)
|
||||||
|
imeisv = "0123456789012345";
|
||||||
|
|
||||||
|
/* We have no clue whatsoever that this lchan still exists! */
|
||||||
|
tx_ciph_mod_compl_hack(cmc->lchan, cmc->link_id, imeisv);
|
||||||
|
|
||||||
|
talloc_free(cmc);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* 8.4.6 ENCRYPTION COMMAND */
|
/* 8.4.6 ENCRYPTION COMMAND */
|
||||||
static int rsl_rx_encr_cmd(struct msgb *msg)
|
static int rsl_rx_encr_cmd(struct msgb *msg)
|
||||||
{
|
{
|
||||||
|
@ -725,17 +752,19 @@ static int rsl_rx_encr_cmd(struct msgb *msg)
|
||||||
|
|
||||||
#ifdef FAKE_CIPH_MODE_COMPL
|
#ifdef FAKE_CIPH_MODE_COMPL
|
||||||
{
|
{
|
||||||
|
struct ciph_mod_compl *cmc;
|
||||||
struct gsm48_hdr *g48h = (struct gsm48_hdr *) l3_content;
|
struct gsm48_hdr *g48h = (struct gsm48_hdr *) l3_content;
|
||||||
const char *imeisv = NULL;
|
|
||||||
|
|
||||||
LOGP(DRSL, LOGL_NOTICE,
|
|
||||||
"%s Sending FAKE CIPHERING MODE COMPLETE to BSC (Alg %u)\n",
|
|
||||||
gsm_lchan_name(lchan), lchan->encr.alg_id);
|
|
||||||
|
|
||||||
|
cmc = talloc_zero(NULL, struct ciph_mod_compl);
|
||||||
if (g48h->data[0] & 0x10)
|
if (g48h->data[0] & 0x10)
|
||||||
imeisv = "0123456789012345";
|
cmc->send_imeisv = 1;
|
||||||
|
cmc->lchan = lchan;
|
||||||
|
cmc->link_id = link_id;
|
||||||
|
cmc->timer.cb = cmc_timer_cb;
|
||||||
|
cmc->timer.data = cmc;
|
||||||
|
osmo_timer_schedule(&cmc->timer, 1, 0);
|
||||||
|
|
||||||
return tx_ciph_mod_compl_hack(lchan, link_id, imeisv);
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
LOGP(DRSL, LOGL_INFO, "%s Fwd RSL ENCR CMD (Alg %u) to LAPDm\n",
|
LOGP(DRSL, LOGL_INFO, "%s Fwd RSL ENCR CMD (Alg %u) to LAPDm\n",
|
||||||
|
|
Loading…
Reference in New Issue