Assume l64a(3) exists
It is required by POSIX.1-2001. Cc: Christian Göttsche <cgzones@googlemail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
parent
48391fb862
commit
55c62b663f
@ -45,7 +45,7 @@ AC_CHECK_HEADERS(crypt.h utmp.h \
|
|||||||
dnl shadow now uses the libc's shadow implementation
|
dnl shadow now uses the libc's shadow implementation
|
||||||
AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
|
AC_CHECK_HEADER([shadow.h],,[AC_MSG_ERROR([You need a libc with shadow.h])])
|
||||||
|
|
||||||
AC_CHECK_FUNCS(arc4random_buf l64a fchmod fchown fsync futimes \
|
AC_CHECK_FUNCS(arc4random_buf fchmod fchown fsync futimes \
|
||||||
getentropy getrandom getspnam getusershell \
|
getentropy getrandom getspnam getusershell \
|
||||||
getutent initgroups lckpwdf lutimes \
|
getutent initgroups lckpwdf lutimes \
|
||||||
setgroups updwtmp updwtmpx innetgr getpwnam_r \
|
setgroups updwtmp updwtmpx innetgr getpwnam_r \
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
*
|
*
|
||||||
* Written by Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>,
|
* Written by Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>,
|
||||||
* it is in the public domain.
|
* it is in the public domain.
|
||||||
*
|
|
||||||
* l64a was Written by J.T. Conklin <jtc@netbsd.org>. Public domain.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@ -111,42 +109,6 @@ static /*@observer@*/unsigned long YESCRYPT_get_salt_cost (/*@null@*/const int *
|
|||||||
static /*@observer@*/void YESCRYPT_salt_cost_to_buf (char *buf, unsigned long cost);
|
static /*@observer@*/void YESCRYPT_salt_cost_to_buf (char *buf, unsigned long cost);
|
||||||
#endif /* USE_YESCRYPT */
|
#endif /* USE_YESCRYPT */
|
||||||
|
|
||||||
#if !USE_XCRYPT_GENSALT && !defined(HAVE_L64A)
|
|
||||||
static /*@observer@*/char *l64a (long value)
|
|
||||||
{
|
|
||||||
static char buf[8];
|
|
||||||
char *s = buf;
|
|
||||||
int digit;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (value < 0) {
|
|
||||||
errno = EINVAL;
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; value != 0 && i < 6; i++) {
|
|
||||||
digit = value & 0x3f;
|
|
||||||
|
|
||||||
if (digit < 2) {
|
|
||||||
*s = digit + '.';
|
|
||||||
} else if (digit < 12) {
|
|
||||||
*s = digit + '0' - 2;
|
|
||||||
} else if (digit < 38) {
|
|
||||||
*s = digit + 'A' - 12;
|
|
||||||
} else {
|
|
||||||
*s = digit + 'a' - 38;
|
|
||||||
}
|
|
||||||
|
|
||||||
value >>= 6;
|
|
||||||
s++;
|
|
||||||
}
|
|
||||||
|
|
||||||
*s = '\0';
|
|
||||||
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
#endif /* !USE_XCRYPT_GENSALT && !defined(HAVE_L64A) */
|
|
||||||
|
|
||||||
/* Read sizeof (long) random bytes from /dev/urandom. */
|
/* Read sizeof (long) random bytes from /dev/urandom. */
|
||||||
static long read_random_bytes (void)
|
static long read_random_bytes (void)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user