crypto/des/str2key.c:95: error: BUFFER_OVERRUN_L2
  Offset: [-4, 25] Size: 16 by call to `des_cbc_cksum`.
Showing all 10 steps of the trace


crypto/des/str2key.c:63:1: Array declaration
61.   OPENSSL_EXTERN int des_check_key;
62.   
63. > void des_string_to_key(const char *str, des_cblock *key)
64.   	{
65.   	des_key_schedule ks;

crypto/des/str2key.c:95:2: Call
93.   	des_set_key(key,ks);
94.   	des_check_key=i;
95.   	des_cbc_cksum((unsigned char*)str,key,length,ks,key);
       ^
96.   	memset(ks,0,sizeof(ks));
97.   	des_set_odd_parity(key);

crypto/des/cbc_cksm.c:61:1: Parameter `*schedule`
  59.   #include "des_locl.h"
  60.   
  61. > DES_LONG des_cbc_cksum(const unsigned char *in, des_cblock *output,
  62.   		long length,
  63.   		des_key_schedule schedule, const_des_cblock *ivec)

crypto/des/cbc_cksm.c:85:3: Call
  83.   		tin0^=tout0; tin[0]=tin0;
  84.   		tin1^=tout1; tin[1]=tin1;
  85.   		des_encrypt((DES_LONG *)tin,schedule,DES_ENCRYPT);
          ^
  86.   		/* fix 15/10/91 eay - thanks to keithr@sco.COM */
  87.   		tout0=tin[0];

crypto/des/des_enc.c:139:8: <Offset trace>
137.   		D_ENCRYPT(r,l, 0); /*  1 */
138.   #else
139.   		for (i=30; i>0; i-=8)
              ^
140.   			{
141.   			D_ENCRYPT(l,r,i-0); /* 16 */

crypto/des/des_enc.c:139:8: Assignment
    137.   		D_ENCRYPT(r,l, 0); /*  1 */
    138.   #else
    139.   		for (i=30; i>0; i-=8)
                  ^
    140.   			{
    141.   			D_ENCRYPT(l,r,i-0); /* 16 */

crypto/des/des_enc.c:61:1: <Length trace>
59.   #include "des_locl.h"
60.   
61. > void des_encrypt(DES_LONG *data, des_key_schedule ks, int enc)
62.   	{
63.   	register DES_LONG l,r,t,u;

crypto/des/des_enc.c:61:1: Parameter `*ks`
    59.   #include "des_locl.h"
    60.   
    61. > void des_encrypt(DES_LONG *data, des_key_schedule ks, int enc)
    62.   	{
    63.   	register DES_LONG l,r,t,u;

crypto/des/des_enc.c:87:2: Assignment
    85.   	l=ROTATE(l,29)&0xffffffffL;
    86.   
    87.   	s=(DES_LONG *)ks;
           ^
    88.   	/* I don't know if it is worth the effort of loop unrolling the
    89.   	 * inner loop */

crypto/des/des_enc.c:144:4: Array access: Offset: [-4, 25] Size: 16 by call to `des_cbc_cksum` 
    142.   			D_ENCRYPT(r,l,i-2); /* 15 */
    143.   			D_ENCRYPT(l,r,i-4); /* 14 */
    144.   			D_ENCRYPT(r,l,i-6); /* 13 */
              ^
    145.   			}
    146.   #endif

void des_encrypt(DES_LONG *data, des_key_schedule ks, int enc)
	{
	register DES_LONG l,r,t,u;
#ifdef DES_PTR
	register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
#endif
#ifndef DES_UNROLL
	register int i;
#endif
	register DES_LONG *s;
	r=data[0];
	l=data[1];
	IP(r,l);
	r=ROTATE(r,29)&0xffffffffL;
	l=ROTATE(l,29)&0xffffffffL;
	s=(DES_LONG *)ks;
	if (enc)
		{
#ifdef DES_UNROLL
		D_ENCRYPT(l,r, 0);
		D_ENCRYPT(r,l, 2);
		D_ENCRYPT(l,r, 4);
		D_ENCRYPT(r,l, 6);
		D_ENCRYPT(l,r, 8);
		D_ENCRYPT(r,l,10);
		D_ENCRYPT(l,r,12);
		D_ENCRYPT(r,l,14);
		D_ENCRYPT(l,r,16);
		D_ENCRYPT(r,l,18);
		D_ENCRYPT(l,r,20);
		D_ENCRYPT(r,l,22);
		D_ENCRYPT(l,r,24);
		D_ENCRYPT(r,l,26);
		D_ENCRYPT(l,r,28);
		D_ENCRYPT(r,l,30);
#else
		for (i=0; i<32; i+=8)
			{
			D_ENCRYPT(l,r,i+0);
			D_ENCRYPT(r,l,i+2);
			D_ENCRYPT(l,r,i+4);
			D_ENCRYPT(r,l,i+6);
			}
#endif
		}
	else
		{
#ifdef DES_UNROLL
		D_ENCRYPT(l,r,30);
		D_ENCRYPT(r,l,28);
		D_ENCRYPT(l,r,26);
		D_ENCRYPT(r,l,24);
		D_ENCRYPT(l,r,22);
		D_ENCRYPT(r,l,20);
		D_ENCRYPT(l,r,18);
		D_ENCRYPT(r,l,16);
		D_ENCRYPT(l,r,14);
		D_ENCRYPT(r,l,12);
		D_ENCRYPT(l,r,10);
		D_ENCRYPT(r,l, 8);
		D_ENCRYPT(l,r, 6);
		D_ENCRYPT(r,l, 4);
		D_ENCRYPT(l,r, 2);
		D_ENCRYPT(r,l, 0);
#else
		for (i=30; i>0; i-=8)
			{
			D_ENCRYPT(l,r,i-0);
			D_ENCRYPT(r,l,i-2);
			D_ENCRYPT(l,r,i-4);
			D_ENCRYPT(r,l,i-6);
			}
#endif
		}
	l=ROTATE(l,3)&0xffffffffL;
	r=ROTATE(r,3)&0xffffffffL;
	FP(r,l);
	data[0]=l;
	data[1]=r;
	l=r=t=u=0;
	}
['void des_string_to_key(const char *str, des_cblock *key)\n\t{\n\tdes_key_schedule ks;\n\tint i,length;\n\tregister unsigned char j;\n\tmemset(key,0,8);\n\tlength=strlen(str);\n#ifdef OLD_STR_TO_KEY\n\tfor (i=0; i<length; i++)\n\t\t(*key)[i%8]^=(str[i]<<1);\n#else\n\tfor (i=0; i<length; i++)\n\t\t{\n\t\tj=str[i];\n\t\tif ((i%16) < 8)\n\t\t\t(*key)[i%8]^=(j<<1);\n\t\telse\n\t\t\t{\n\t\t\tj=((j<<4)&0xf0)|((j>>4)&0x0f);\n\t\t\tj=((j<<2)&0xcc)|((j>>2)&0x33);\n\t\t\tj=((j<<1)&0xaa)|((j>>1)&0x55);\n\t\t\t(*key)[7-(i%8)]^=j;\n\t\t\t}\n\t\t}\n#endif\n\tdes_set_odd_parity(key);\n\ti=des_check_key;\n\tdes_check_key=0;\n\tdes_set_key(key,ks);\n\tdes_check_key=i;\n\tdes_cbc_cksum((unsigned char*)str,key,length,ks,key);\n\tmemset(ks,0,sizeof(ks));\n\tdes_set_odd_parity(key);\n\t}', 'DES_LONG des_cbc_cksum(const unsigned char *in, des_cblock *output,\n\t\tlong length,\n\t\tdes_key_schedule schedule, const_des_cblock *ivec)\n\t{\n\tregister DES_LONG tout0,tout1,tin0,tin1;\n\tregister long l=length;\n\tDES_LONG tin[2];\n\tunsigned char *out = &(*output)[0];\n\tconst unsigned char *iv = &(*ivec)[0];\n\tc2l(iv,tout0);\n\tc2l(iv,tout1);\n\tfor (; l>0; l-=8)\n\t\t{\n\t\tif (l >= 8)\n\t\t\t{\n\t\t\tc2l(in,tin0);\n\t\t\tc2l(in,tin1);\n\t\t\t}\n\t\telse\n\t\t\tc2ln(in,tin0,tin1,l);\n\t\ttin0^=tout0; tin[0]=tin0;\n\t\ttin1^=tout1; tin[1]=tin1;\n\t\tdes_encrypt((DES_LONG *)tin,schedule,DES_ENCRYPT);\n\t\ttout0=tin[0];\n\t\ttout1=tin[1];\n\t\t}\n\tif (out != NULL)\n\t\t{\n\t\tl2c(tout0,out);\n\t\tl2c(tout1,out);\n\t\t}\n\ttout0=tin0=tin1=tin[0]=tin[1]=0;\n\treturn(tout1);\n\t}', 'void des_encrypt(DES_LONG *data, des_key_schedule ks, int enc)\n\t{\n\tregister DES_LONG l,r,t,u;\n#ifdef DES_PTR\n\tregister const unsigned char *des_SP=(const unsigned char *)des_SPtrans;\n#endif\n#ifndef DES_UNROLL\n\tregister int i;\n#endif\n\tregister DES_LONG *s;\n\tr=data[0];\n\tl=data[1];\n\tIP(r,l);\n\tr=ROTATE(r,29)&0xffffffffL;\n\tl=ROTATE(l,29)&0xffffffffL;\n\ts=(DES_LONG *)ks;\n\tif (enc)\n\t\t{\n#ifdef DES_UNROLL\n\t\tD_ENCRYPT(l,r, 0);\n\t\tD_ENCRYPT(r,l, 2);\n\t\tD_ENCRYPT(l,r, 4);\n\t\tD_ENCRYPT(r,l, 6);\n\t\tD_ENCRYPT(l,r, 8);\n\t\tD_ENCRYPT(r,l,10);\n\t\tD_ENCRYPT(l,r,12);\n\t\tD_ENCRYPT(r,l,14);\n\t\tD_ENCRYPT(l,r,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