mirror of
https://github.com/sudo-project/sudo.git
synced 2025-09-04 00:05:11 +00:00
SPW_SECUREWARE now uses bigcrypt
This commit is contained in:
23
check.c
23
check.c
@@ -67,7 +67,11 @@ static char rcsid[] = "$Id$";
|
|||||||
#include <options.h>
|
#include <options.h>
|
||||||
#include "insults.h"
|
#include "insults.h"
|
||||||
#if defined(SHADOW_TYPE) && (SHADOW_TYPE == SPW_SECUREWARE)
|
#if defined(SHADOW_TYPE) && (SHADOW_TYPE == SPW_SECUREWARE)
|
||||||
|
# ifdef __hpux
|
||||||
|
# include <hpsecurity.h>
|
||||||
|
# else
|
||||||
# include <sys/security.h>
|
# include <sys/security.h>
|
||||||
|
# endif /* __hpux */
|
||||||
# include <prot.h>
|
# include <prot.h>
|
||||||
#endif /* SHADOW_TYPE == SPW_SECUREWARE */
|
#endif /* SHADOW_TYPE == SPW_SECUREWARE */
|
||||||
#ifdef HAVE_KERB4
|
#ifdef HAVE_KERB4
|
||||||
@@ -445,12 +449,8 @@ static void check_passwd()
|
|||||||
{
|
{
|
||||||
char *pass; /* this is what gets entered */
|
char *pass; /* this is what gets entered */
|
||||||
register int counter = TRIES_FOR_PASSWORD;
|
register int counter = TRIES_FOR_PASSWORD;
|
||||||
#if defined(SHADOW_TYPE) && (SHADOW_TYPE == SPW_SECUREWARE)
|
|
||||||
char salt[2]; /* Need the salt to perform the encryption */
|
|
||||||
register int i;
|
|
||||||
#endif /* SHADOW_TYPE == SECUREWARE */
|
|
||||||
#if defined(HAVE_KERB4) && defined(USE_GETPASS)
|
#if defined(HAVE_KERB4) && defined(USE_GETPASS)
|
||||||
char kpass[_PASSWD_LEN];
|
char kpass[_PASSWD_LEN + 1];
|
||||||
#endif /* HAVE_KERB4 && USE_GETPASS */
|
#endif /* HAVE_KERB4 && USE_GETPASS */
|
||||||
|
|
||||||
#ifdef HAVE_SKEY
|
#ifdef HAVE_SKEY
|
||||||
@@ -511,10 +511,13 @@ static void check_passwd()
|
|||||||
return; /* if the passwd is correct return() */
|
return; /* if the passwd is correct return() */
|
||||||
# endif /* ULTRIX4 */
|
# endif /* ULTRIX4 */
|
||||||
# if (SHADOW_TYPE == SPW_SECUREWARE) && !defined(__alpha)
|
# if (SHADOW_TYPE == SPW_SECUREWARE) && !defined(__alpha)
|
||||||
strncpy(salt, user_passwd, 2);
|
# ifdef HAVE_BIGCRYPT
|
||||||
i = AUTH_SALT_SIZE + AUTH_CIPHERTEXT_SEG_CHARS;
|
if (strcmp(user_passwd, (char *) bigcrypt(pass, user_passwd)) == 0)
|
||||||
if (strncmp(user_passwd, crypt(pass, salt), i) == 0)
|
|
||||||
return; /* if the passwd is correct return() */
|
return; /* if the passwd is correct return() */
|
||||||
|
# else
|
||||||
|
if (strcmp(user_passwd, crypt(pass, user_passwd)) == 0)
|
||||||
|
return; /* if the passwd is correct return() */
|
||||||
|
# endif /* HAVE_BIGCRYPT */
|
||||||
# endif /* SECUREWARE && !__alpha */
|
# endif /* SECUREWARE && !__alpha */
|
||||||
# if (SHADOW_TYPE == SPW_SECUREWARE) && defined(__alpha)
|
# if (SHADOW_TYPE == SPW_SECUREWARE) && defined(__alpha)
|
||||||
if (crypt_type == AUTH_CRYPT_BIGCRYPT) {
|
if (crypt_type == AUTH_CRYPT_BIGCRYPT) {
|
||||||
@@ -530,10 +533,6 @@ static void check_passwd()
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
# endif /* SECUREWARE && __alpha */
|
# endif /* SECUREWARE && __alpha */
|
||||||
# if (SHADOW_TYPE == SPW_HPUX10)
|
|
||||||
if (strcmp(user_passwd, (char *) bigcrypt(pass, user_passwd)) == 0)
|
|
||||||
return; /* if the passwd is correct return() */
|
|
||||||
# endif /* HPUX10 */
|
|
||||||
# endif /* SHADOW_TYPE */
|
# endif /* SHADOW_TYPE */
|
||||||
|
|
||||||
/* Normal UN*X password check */
|
/* Normal UN*X password check */
|
||||||
|
Reference in New Issue
Block a user