* sunrpc/xcrypt.c (passwd2des_internal): Renamed fom passwd2des.

(passwd2des): Define it as an alias.
	(xencrypt, xdecrypt): Call passwd2des_internal instead of passwd2des.

2002-09-12  Bruno Haible  <bruno@clisp.org>

	* include/sys/sysctl.h (__sysctl): Add libc_hidden_proto.
	* sysdeps/unix/sysv/linux/sysctl.c (__sysctl): Add libc_hidden_def.

	* include/rpc/xdr.h (xdrstdio_create): Add libc_hidden_proto.
	* sunrpc/xdr_stdio.c (xdrstdio_create): Add libc_hidden_def.
This commit is contained in:
Roland McGrath 2002-09-17 10:58:17 +00:00
parent 39d003fb0e
commit e436294bb2
6 changed files with 49 additions and 19 deletions

View File

@ -1,3 +1,17 @@
2002-09-17 Roland McGrath <roland@redhat.com>
* sunrpc/xcrypt.c (passwd2des_internal): Renamed fom passwd2des.
(passwd2des): Define it as an alias.
(xencrypt, xdecrypt): Call passwd2des_internal instead of passwd2des.
2002-09-12 Bruno Haible <bruno@clisp.org>
* include/sys/sysctl.h (__sysctl): Add libc_hidden_proto.
* sysdeps/unix/sysv/linux/sysctl.c (__sysctl): Add libc_hidden_def.
* include/rpc/xdr.h (xdrstdio_create): Add libc_hidden_proto.
* sunrpc/xdr_stdio.c (xdrstdio_create): Add libc_hidden_def.
2002-09-05 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/kernel-features.h [__powerpc64__]

View File

@ -32,3 +32,5 @@ extern void xdrmem_create_internal (XDR *, const caddr_t, u_int, enum xdr_op);
extern bool_t xdrrec_endofrecord_internal (XDR *__xdrs, bool_t __sendnow);
extern bool_t xdrrec_skiprecord_internal (XDR *__xdrs);
extern bool_t xdrrec_eof_internal (XDR *__xdrs);
libc_hidden_proto (xdrstdio_create)

View File

@ -4,6 +4,7 @@
/* Read or write system parameters (Linux, FreeBSD specific). */
extern int __sysctl (int *__name, int __nlen, void *__oldval,
size_t *__oldlenp, void *__newval, size_t __newlen);
libc_hidden_proto (__sysctl)
#endif /* _SYS_SYSCTL_H */

View File

@ -69,7 +69,32 @@ static char hexval (char) internal_function;
static void hex2bin (int, char *, char *) internal_function;
static void bin2hex (int, unsigned char *, char *) internal_function;
void passwd2des (char *pw, char *key);
static void passwd2des_internal (char *pw, char *key);
/*
* Turn password into DES key
*/
static void
passwd2des_internal (char *pw, char *key)
{
int i;
memset (key, 0, 8);
for (i = 0; *pw && i < 8; ++i)
key[i] ^= *pw++ << 1;
des_setparity (key);
}
#ifdef _LIBC
strong_alias (passwd2des_internal, passwd2des)
#else
void passwd2des (char *pw, char *key)
{
return passwd2des_internal (pw, key);
}
#endif
/*
* Encrypt a secret key given passwd
@ -88,7 +113,7 @@ xencrypt (char *secret, char *passwd)
len = strlen (secret) / 2;
buf = malloc ((unsigned) len);
hex2bin (len, secret, buf);
passwd2des (passwd, key);
passwd2des_internal (passwd, key);
memset (ivec, 0, 8);
err = cbc_crypt (key, buf, len, DES_ENCRYPT | DES_HW, ivec);
@ -120,7 +145,7 @@ xdecrypt (char *secret, char *passwd)
buf = malloc ((unsigned) len);
hex2bin (len, secret, buf);
passwd2des (passwd, key);
passwd2des_internal (passwd, key);
memset (ivec, 0, 8);
err = cbc_crypt (key, buf, len, DES_DECRYPT | DES_HW, ivec);
@ -134,21 +159,6 @@ xdecrypt (char *secret, char *passwd)
return 1;
}
/*
* Turn password into DES key
*/
void
passwd2des (char *pw, char *key)
{
int i;
memset (key, 0, 8);
for (i = 0; *pw && i < 8; ++i)
key[i] ^= *pw++ << 1;
des_setparity (key);
}
/*
* Hex to binary conversion
*/

View File

@ -192,3 +192,5 @@ xdrstdio_putint32 (XDR *xdrs, const int32_t *ip)
return FALSE;
return TRUE;
}
libc_hidden_def (xdrstdio_create)

View File

@ -1,5 +1,5 @@
/* Read or write system information. Linux version.
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1996-1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -46,4 +46,5 @@ __sysctl (int *name, int nlen, void *oldval, size_t *oldlenp,
return INLINE_SYSCALL (_sysctl, 1, __ptrvalue (&args));
}
libc_hidden_def (__sysctl)
weak_alias (__sysctl, sysctl)