* configure.in: New configure option: --with-sha-crypt enabled by

default. Keeping the feature enabled is safe. Disabling it permits
  to disable the references to the SHA256 and SHA512 password
  encryption algorithms from the usage help and manuals (in addition
  to the support for these algorithms in the code).
* libmisc/obscure.c, libmisc/salt.c, src/newusers.c,
  src/chpasswd.c, src/chgpasswd.c, src/passwd.c: ENCRYPT_METHOD is
  always supported in login.defs. Remove the ENCRYPTMETHOD_SELECT
  preprocessor condition.
* libmisc/obscure.c, libmisc/salt.c, src/newusers.c,
  src/chpasswd.c, src/chgpasswd.c, src/passwd.c: Disable SHA256 and
  SHA512 if USE_SHA_CRYPT is not defined (this corresponds to a
  subset of the ENCRYPTMETHOD_SELECT sections).
This commit is contained in:
nekral-guest
2007-11-24 13:08:08 +00:00
parent ee5c48d51c
commit 4d606cc690
8 changed files with 54 additions and 37 deletions

View File

@ -84,7 +84,7 @@ static void usage (void)
"%s"
"\n"),
Prog,
#ifndef ENCRYPTMETHOD_SELECT
#ifndef USE_SHA_CRYPT
"NONE DES MD5", ""
#else
"NONE DES MD5 SHA256 SHA512",
@ -344,7 +344,7 @@ int main (int argc, char **argv)
static struct option long_options[] = {
{"crypt-method", required_argument, NULL, 'c'},
{"help", no_argument, NULL, 'h'},
#ifdef ENCRYPTMETHOD_SELECT
#ifdef USE_SHA_CRYPT
{"sha-rounds", required_argument, NULL, 's'},
#endif
{NULL, 0, NULL, '\0'}
@ -352,7 +352,7 @@ int main (int argc, char **argv)
while ((c =
getopt_long (argc, argv,
#ifdef ENCRYPTMETHOD_SELECT
#ifdef USE_SHA_CRYPT
"c:hs:",
#else
"c:h",
@ -367,7 +367,7 @@ int main (int argc, char **argv)
case 'h':
usage ();
break;
#ifdef ENCRYPTMETHOD_SELECT
#ifdef USE_SHA_CRYPT
case 's':
sflg = 1;
if (!getlong(optarg, &sha_rounds)) {
@ -399,7 +399,7 @@ int main (int argc, char **argv)
if ( 0 != strcmp (crypt_method, "DES")
&& 0 != strcmp (crypt_method, "MD5")
&& 0 != strcmp (crypt_method, "NONE")
#ifdef ENCRYPTMETHOD_SELECT
#ifdef USE_SHA_CRYPT
&& 0 != strcmp (crypt_method, "SHA256")
&& 0 != strcmp (crypt_method, "SHA512")
#endif