centos 6
crypto weakness #304


Weakness Breakdown


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:



The highlighted line of code below is the trigger point of this particular Centos 6 crypto weakness.

#ifndef NO_CRYPT

    int i;
    char *srpp = NULL;
    struct passwd *pw;

#undef XCRYPT

#if defined(HAVE_AUTH_H) && defined(HAVE_GETAUTHUID)

    struct authorization *apw;
    extern char *crypt16 (const char *, const char *);

# define XCRYPT(a, b) crypt16(a, b)

    if ((pw = xgetpwuid(euid)) != NULL &&	/* effective user passwd  */
        (apw = getauthuid(euid)) != NULL) 	/* enhanced ultrix passwd */
	srpp = apw->a_password;

#elif defined(HAVE_SHADOW_H)

    struct spwd *spw;

# define XCRYPT(a, b) crypt(a, b)

    if ((pw = xgetpwuid(euid)) != NULL)	{	/* effective user passwd  */
	errno = 0;
	while ((spw = getspnam(pw->pw_name)) == NULL && errno == EINTR) {
	    errno = 0;
	if (spw != NULL)			 /* shadowed passwd	  */
	    srpp = spw->sp_pwdp;


#define XCRYPT(a, b) crypt(a, b)

#if !defined(__MVS__)
    if ((pw = xgetpwuid(euid)) != NULL)	/* effective user passwd  */
	srpp = pw->pw_passwd;
#endif /* !MVS */


    if (srpp == NULL) {

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.