aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-06-08 18:02:10 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-07-01 08:16:41 +0200
commite2ac6b77feecc5b7194a308bbd11e206c4a41fcb (patch)
tree02088c69891c0c64124c3e3c74c8bad5462b175a /openbsc/src/libbsc
parent9705671025eba34b70d73e9d4e78813e4f2d31da (diff)
bsc: Check for the rand and then generate a res
Check if the NAT has sent 16 bytes of RAND and if a key has been configured in the system and then generate a result using milenage. The milenage res will be sent and noth the four byte GSM SRES derivation.
Diffstat (limited to 'openbsc/src/libbsc')
-rw-r--r--openbsc/src/libbsc/bsc_msc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/bsc_msc.c b/openbsc/src/libbsc/bsc_msc.c
index fc4530ce7..829ee2b54 100644
--- a/openbsc/src/libbsc/bsc_msc.c
+++ b/openbsc/src/libbsc/bsc_msc.c
@@ -276,7 +276,7 @@ void bsc_msc_schedule_connect(struct bsc_msc_connection *con)
osmo_timer_schedule(&con->reconnect_timer, 5, 0);
}
-struct msgb *bsc_msc_id_get_resp(int fixed, const char *token)
+struct msgb *bsc_msc_id_get_resp(int fixed, const char *token, const uint8_t *res, int len)
{
struct msgb *msg;
@@ -302,6 +302,11 @@ struct msgb *bsc_msc_id_get_resp(int fixed, const char *token)
msgb_put_u8(msg, 0);
msgb_put_u8(msg, strlen(token) + 2);
msgb_tv_fixed_put(msg, IPAC_IDTAG_UNITNAME, strlen(token) + 1, (uint8_t *) token);
+ if (len > 0) {
+ msgb_put_u8(msg, 0);
+ msgb_put_u8(msg, len + 1);
+ msgb_tv_fixed_put(msg, 0x24, len, res);
+ }
} else {
msgb_l16tv_put(msg, strlen(token) + 1,
IPAC_IDTAG_UNITNAME, (uint8_t *) token);