aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc/osmo_bsc_vty.c
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/osmo-bsc/osmo_bsc_vty.c
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/osmo-bsc/osmo_bsc_vty.c')
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_vty.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_vty.c b/openbsc/src/osmo-bsc/osmo_bsc_vty.c
index 06ad77d59..9a17cd064 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_vty.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_vty.c
@@ -107,6 +107,9 @@ static void write_msc(struct vty *vty, struct osmo_msc_data *msc)
vty_out(vty, "msc %d%s", msc->nr, VTY_NEWLINE);
if (msc->bsc_token)
vty_out(vty, " token %s%s", msc->bsc_token, VTY_NEWLINE);
+ if (msc->bsc_key_present)
+ vty_out(vty, " auth-key %s%s",
+ osmo_hexdump(msc->bsc_key, sizeof(msc->bsc_key)), VTY_NEWLINE);
if (msc->core_ncc != -1)
vty_out(vty, " core-mobile-network-code %d%s",
msc->core_ncc, VTY_NEWLINE);
@@ -231,6 +234,30 @@ DEFUN(cfg_net_bsc_token,
return CMD_SUCCESS;
}
+DEFUN(cfg_net_bsc_key,
+ cfg_net_bsc_key_cmd,
+ "auth-key KEY",
+ "Authentication (secret) key configuration\n"
+ "Security key\n")
+{
+ struct osmo_msc_data *data = osmo_msc_data(vty);
+
+ osmo_hexparse(argv[0], data->bsc_key, sizeof(data->bsc_key));
+ data->bsc_key_present = 1;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_no_bsc_key, cfg_net_bsc_no_key_cmd,
+ "no auth-key",
+ NO_STR "Authentication (secret) key configuration\n")
+{
+ struct osmo_msc_data *data = osmo_msc_data(vty);
+
+ memset(data->bsc_key, 0, sizeof(data->bsc_key));
+ data->bsc_key_present = 0;
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_net_bsc_ncc,
cfg_net_bsc_ncc_cmd,
"core-mobile-network-code <1-999>",
@@ -871,6 +898,8 @@ int bsc_vty_init_extra(void)
install_node(&msc_node, config_write_msc);
vty_install_default(MSC_NODE);
install_element(MSC_NODE, &cfg_net_bsc_token_cmd);
+ install_element(MSC_NODE, &cfg_net_bsc_key_cmd);
+ install_element(MSC_NODE, &cfg_net_bsc_no_key_cmd);
install_element(MSC_NODE, &cfg_net_bsc_ncc_cmd);
install_element(MSC_NODE, &cfg_net_bsc_mcc_cmd);
install_element(MSC_NODE, &cfg_net_bsc_lac_cmd);