changeset 3:8dfa3bfaa9c1

Sysmocom 2DES keys don't have correct parity
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 21 Feb 2021 22:34:03 +0000
parents d5e9af482548
children c2de42994e57
files smswrap/ota-smswrap-sjs1.c
diffstat 1 files changed, 2 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/smswrap/ota-smswrap-sjs1.c	Sun Feb 21 22:21:29 2021 +0000
+++ b/smswrap/ota-smswrap-sjs1.c	Sun Feb 21 22:34:03 2021 +0000
@@ -43,15 +43,8 @@
 	rc = decode_hex_data_from_string(arg, keybin, 16, 16);
 	if (rc < 0)
 		exit(1);	/* error msg already printed */
-	for (n = 0; n < 2; n++) {
-		rc = DES_set_key_checked(keybin + n, sched + n);
-		if (rc < 0) {
-			fprintf(stderr,
-	"bad %s argument: DES_set_key_checked() returned %d on part %u\n",
-				name, rc, n);
-			exit(1);
-		}
-	}
+	for (n = 0; n < 2; n++)
+		DES_set_key_unchecked(keybin + n, sched + n);
 }
 
 read_payload()