changeset 93:6041c601304d

fcsim1-mkprov: revert OTA key addition It appears that GrcardSIM2 cards (which is what we got for FCSIM1) do not support OTA after all, contrary to what we were previously led to believe by some tech support emails from Grcard - apparently those support emails and OTA descriptions referred to some other card model(s).
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 21 Apr 2021 05:38:39 +0000
parents 5560261fc516
children 3d9c50880ae7
files utils/fcsim1-mkprov.c
diffstat 1 files changed, 5 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/utils/fcsim1-mkprov.c	Sun Apr 11 04:55:02 2021 +0000
+++ b/utils/fcsim1-mkprov.c	Wed Apr 21 05:38:39 2021 +0000
@@ -93,23 +93,8 @@
 	set_imsi(argv[optind+1]);
 }
 
-static unsigned
-make_odd_parity(byte)
-	unsigned byte;
-{
-	unsigned mask, p;
-
-	p = 0;
-	for (mask = 0x80; mask; mask >>= 1)
-		if (byte & mask)
-			p = !p;
-	if (!p)
-		byte ^= 0x01;
-	return byte;
-}
-
 static void
-get_random_key(strbuf, oddpar)
+get_random_ki(strbuf)
 	char *strbuf;
 {
 	u_char bin[16];
@@ -122,10 +107,6 @@
 		fprintf(stderr, "error reading from %s\n", random_file);
 		exit(1);
 	}
-	if (oddpar) {
-		for (n = 0; n < 16; n++)
-			bin[n] = make_odd_parity(bin[n]);
-	}
 	dp = strbuf;
 	for (n = 0; n < 16; n++) {
 		sprintf(dp, "%02X", bin[n]);
@@ -139,16 +120,14 @@
 {
 	unsigned acc_mask;
 	char iccid_str[20], imsi_str[16], ki_str[33];
-	char msisdn_str[21], otac_str[33], otad_str[33];
+	char msisdn_str[21];
 
 	nibbles_to_ascii(iccid_bin, 19, iccid_str);
 	nibbles_to_ascii(imsi_bin, 15, imsi_str);
 	acc_mask = 1 << access_class;
-	get_random_key(ki_str, 0);
-	get_random_key(otac_str, 1);
-	get_random_key(otad_str, 1);
-	printf("ICCID=%s IMSI=%s ACC=%04X Ki=%s OTA_C=%s OTA_D=%s", iccid_str,
-		imsi_str, acc_mask, ki_str, otac_str, otad_str);
+	get_random_ki(ki_str);
+	printf("ICCID=%s IMSI=%s ACC=%04X Ki=%s", iccid_str, imsi_str,
+		acc_mask, ki_str);
 	if (msisdn_set) {
 		fputs(" MSISDN=", stdout);
 		if (msisdn_plus)