dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/engine lib_crypt.c,1.8,1.9


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/engine lib_crypt.c,1.8,1.9
Date: Mon, 25 Nov 2002 17:55:37 -0500

Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv20893/engine

Modified Files:
        lib_crypt.c 
Log Message:


_IL_CryptoMethods_SameKey: ignore the DES parity bit when checking Triple-DES
key components for equality.


Index: lib_crypt.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_crypt.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** lib_crypt.c 17 Jul 2002 05:04:52 -0000      1.8
--- lib_crypt.c 25 Nov 2002 22:55:35 -0000      1.9
***************
*** 350,355 ****
                                                                 ILInt32 
offset2)
  {
!       return !ILMemCmp(((unsigned char *)(ArrayToBuffer(key1))) + offset1,
!                                        ((unsigned char 
*)(ArrayToBuffer(key2))) + offset2, 8);
  }
  
--- 350,368 ----
                                                                 ILInt32 
offset2)
  {
!       unsigned char *ptr1 = ((unsigned char *)(ArrayToBuffer(key1))) + 
offset1;
!       unsigned char *ptr2 = ((unsigned char *)(ArrayToBuffer(key2))) + 
offset2;
!       int len = 8;
!       while(len > 0)
!       {
!               /* Ignore the DES parity bit, as it isn't important */
!               if((*ptr1 & 0xFE) != (*ptr2 & 0xFE))
!               {
!                       return 0;
!               }
!               ++ptr1;
!               ++ptr2;
!               --len;
!       }
!       return 1;
  }
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]