|
Lines 1-5
Link Here
|
| 1 |
--- cyberflex.c.orig Thu Jun 19 23:37:35 2003 |
1 |
--- cyberflex.c.orig 2003-06-20 00:37:35.000000000 +0200 |
| 2 |
+++ cyberflex.c Mon Sep 29 00:58:56 2003 |
2 |
+++ cyberflex.c 2015-02-28 15:57:55.093727371 +0100 |
| 3 |
@@ -48,7 +48,13 @@ |
3 |
@@ -48,7 +48,13 @@ |
| 4 |
#define SHA1Init SHA1_Init |
4 |
#define SHA1Init SHA1_Init |
| 5 |
#define SHA1Update SHA1_Update |
5 |
#define SHA1Update SHA1_Update |
|
Lines 15-17
Link Here
|
| 15 |
#include <sha1.h> |
15 |
#include <sha1.h> |
| 16 |
#endif |
16 |
#endif |
| 17 |
#else |
17 |
#else |
|
|
18 |
@@ -69,7 +75,7 @@ |
| 19 |
#include "sc.h" |
| 20 |
|
| 21 |
#ifdef __sun |
| 22 |
-#define des_set_key(key, schedule) des_key_sched(key, schedule) |
| 23 |
+#define DES_set_key(key, &schedule) DES_key_sched(key, &schedule) |
| 24 |
#endif |
| 25 |
|
| 26 |
#define JDIRSIZE 40 |
| 27 |
@@ -91,7 +97,7 @@ |
| 28 |
|
| 29 |
#ifndef __palmos__ |
| 30 |
/* default signed applet key of Cyberflex Access */ |
| 31 |
-static des_cblock app_key = {0x6A, 0x21, 0x36, 0xF5, 0xD8, 0x0C, 0x47, 0x83}; |
| 32 |
+static DES_cblock app_key = {0x6A, 0x21, 0x36, 0xF5, 0xD8, 0x0C, 0x47, 0x83}; |
| 33 |
#endif |
| 34 |
|
| 35 |
static int |
| 36 |
@@ -663,8 +669,8 @@ |
| 37 |
unsigned char aid[16], app_data[MAX_APP_SIZE], data[MAX_BUF_SIZE]; |
| 38 |
int i, j, vflag = 0, gotprog = 0, gotcont = 0, fd_app, size, aidlen = 0, sw; |
| 39 |
int cont_size = 1152, inst_size = 1024; |
| 40 |
- des_cblock tmp; |
| 41 |
- des_key_schedule schedule; |
| 42 |
+ DES_cblock tmp; |
| 43 |
+ DES_key_schedule schedule; |
| 44 |
static unsigned char acl[] = {0x81, 0, 0, 0xff, 0, 0, 0, 0}; |
| 45 |
|
| 46 |
optind = optreset = 1; |
| 47 |
@@ -777,12 +783,12 @@ |
| 48 |
/* chain. DES encrypt one block, XOR the cyphertext with the next block, |
| 49 |
... continues until the end of the buffer */ |
| 50 |
|
| 51 |
- des_set_key (&app_key, schedule); |
| 52 |
+ DES_set_key (&app_key, &schedule); |
| 53 |
|
| 54 |
for (i = 0; i < size/BLOCK_SIZE; i++) { |
| 55 |
for (j = 0; j < BLOCK_SIZE; j++) |
| 56 |
tmp[j] = tmp[j] ^ app_data[i*BLOCK_SIZE + j]; |
| 57 |
- des_ecb_encrypt (&tmp, &tmp, schedule, DES_ENCRYPT); |
| 58 |
+ DES_ecb_encrypt (&tmp, &tmp, &schedule, DES_ENCRYPT); |
| 59 |
} |
| 60 |
|
| 61 |
if (vflag) { |