alpine 3.6
crypto weakness #46

4

Weakness Breakdown


Definition:

This weakness involves creating non-standard or non-tested algorithms, using weak algorithms or applying cryptographic algorithms incorrectly. Algorithms that were once considered safe are commonly later found to be unsafe, as the algorithms were broken.

Warning code(s):

The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment.

File Name:

libressl/src/libressl-2.5.5/tests/destest.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.6 crypto weakness.

 		{
		printf("quad_cksum error, out[3] %08lx is not %08lx\n",
			(unsigned long)lqret[3],0x501c2c26UL);
		err=1;
		}

	printf("input word alignment test");
	for (i=0; i<4; i++)
		{
		printf(" %u",i);
		DES_ncbc_encrypt(&(cbc_out[i]),cbc_in,
				 strlen((char *)cbc_data)+1,&ks,
				 &cbc_iv,DES_ENCRYPT);
		}
	printf("\noutput word alignment test");
	for (i=0; i<4; i++)
		{
		printf(" %u",i);
		DES_ncbc_encrypt(cbc_out,&(cbc_in[i]),
				 strlen((char *)cbc_data)+1,&ks,
				 &cbc_iv,DES_ENCRYPT);
		}
	printf("\n");
	printf("fast crypt test ");
	str=crypt("testing","ef");
	if (strcmp("efGnQx2725bI2",str) != 0)
		{
		printf("fast crypt error, %s should be efGnQx2725bI2\n",str);
		err=1;
		}
	str=crypt("bca76;23","yA");
	if (strcmp("yA1Rp/1hZXIJk",str) != 0)
		{
		printf("fast crypt error, %s should be yA1Rp/1hZXIJk\n",str);
		err=1;
		}
	printf("\n");
	return(err);
	}

static char *pt(unsigned char *p)
	{
	static char bufs[10][20];
	static int bnum=0;
	char *ret;
	int i;
	static char *f="0123456789ABCDEF";

	ret= &(bufs[bnum++][0]);
	bnum%=10; 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.