Project

General

Profile

Feature #2460 ยป encryption.diff

laforge, 12/23/2017 05:25 PM

View differences:

include/osmocom/msc/gsm_data.h
369 369
	regex_t authorized_regexp;
370 370
	char *authorized_reg_str;
371 371
	enum gsm48_reject_value reject_cause;
372
	int a5_encryption;
372
	/* bit-mask of permitted encryption algorithms. LSB=A5/0, MSB=A5/7 */
373
	int a5_encryption_mask;
373 374
	bool authentication_required;
374 375
	int neci;
375 376
	int send_mm_info;
src/libcommon-cs/common_cs.c
56 56

  
57 57
	net->country_code = country_code;
58 58
	net->network_code = network_code;
59
	/* Permit a compile-time default of A5/3 and A5/1 */
60
	net->a5_encryption_mask = (1 << 3) | (1 << 1);
59 61

  
60 62
	/* Use 30 min periodic update interval as sane default */
61 63
	net->t3212 = 5;
src/libcommon-cs/common_cs_vty.c
155 155

  
156 156
DEFUN(cfg_net_encryption,
157 157
      cfg_net_encryption_cmd,
158
      "encryption a5 (0|1|2|3)",
158
      "encryption a5 <0-3> [<0-3>] [<0-3>] [<0-3>]",
159 159
	"Encryption options\n"
160
	"A5 encryption\n" "A5/0: No encryption\n"
161
	"A5/1: Encryption\n" "A5/2: Export-grade Encryption\n"
162
	"A5/3: 'New' Secure Encryption\n")
160
	"GSM A5 Air Interface Encryption\n"
161
	"A5/n Algorithm Number\n"
162
	"A5/n Algorithm Number\n"
163
	"A5/n Algorithm Number\n"
164
	"A5/n Algorithm Number\n")
163 165
{
164 166
	struct gsm_network *gsmnet = gsmnet_from_vty(vty);
167
	unsigned int i;
165 168

  
166
	gsmnet->a5_encryption = atoi(argv[0]);
169
	gsmnet->a5_encryption_mask = 0;
170
	for (i = 0; i < argc; i++)
171
		gsmnet->a5_encryption_mask |= (1 << atoi(argv[i]));
167 172

  
168 173
	return CMD_SUCCESS;
169 174
}
src/libmsc/msc_vty.c
1 1
/* MSC interface to quagga VTY */
2 2
/* (C) 2016 by sysmocom s.m.f.c. GmbH <info@sysmocom.de>
3 3
 * Based on OpenBSC interface to quagga VTY (libmsc/vty_interface_layer3.c)
4
 * (C) 2009 by Harald Welte <laforge@gnumonks.org>
4
 * (C) 2009-2017 by Harald Welte <laforge@gnumonks.org>
5 5
 * (C) 2009-2011 by Holger Hans Peter Freyther
6 6
 * All Rights Reserved
7 7
 *
......
169 169
	vty_out(vty, " auth policy %s%s", gsm_auth_policy_name(gsmnet->auth_policy), VTY_NEWLINE);
170 170
	vty_out(vty, " location updating reject cause %u%s",
171 171
		gsmnet->reject_cause, VTY_NEWLINE);
172
	vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE);
172
	vty_out(vty, " encryption a5");
173
	for (int i = 0; i < 8; i++) {
174
		if (gsmnet->a5_encryption_mask & (1 << i))
175
			vty_out(vty, " %u", i);
176
	}
177
	vty_out(vty, "%s", VTY_NEWLINE);
173 178
	vty_out(vty, " authentication %s%s",
174 179
		gsmnet->authentication_required ? "required" : "optional", VTY_NEWLINE);
175 180
	vty_out(vty, " rrlp mode %s%s", rrlp_mode_name(gsmnet->rrlp.mode),
    (1-1/1)
    Add picture from clipboard (Maximum size: 48.8 MB)