don't modify des/3des input key anymore
authorMartin Willi <martin@strongswan.org>
Tue, 19 Jun 2007 07:56:28 +0000 (07:56 -0000)
committerMartin Willi <martin@strongswan.org>
Tue, 19 Jun 2007 07:56:28 +0000 (07:56 -0000)
src/libstrongswan/crypto/crypters/des_crypter.c

index dc5a8ff..655cc03 100644 (file)
@@ -871,14 +871,15 @@ static int des_set_key(des_cblock *key, des_key_schedule *schedule)
        register unsigned char *in;
        register DES_LONG *k;
        register int i;
+       des_cblock odd;
 
        for (i = 0; i < sizeof(des_cblock); i++)
        {
-               (*key)[i] = odd_parity[(*key)[i]];
+               odd[i] = odd_parity[(*key)[i]];
        }
 
        k=(DES_LONG *)schedule;
-       in=(unsigned char *)key;
+       in=(unsigned char *)&odd;
 
        c2l(in,c);
        c2l(in,d);