diff options
Diffstat (limited to 'md5-crypt/md5-crypt.c')
-rw-r--r-- | md5-crypt/md5-crypt.c | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/md5-crypt/md5-crypt.c b/md5-crypt/md5-crypt.c index 308366c4dd..6dd6740671 100644 --- a/md5-crypt/md5-crypt.c +++ b/md5-crypt/md5-crypt.c @@ -1,22 +1,22 @@ -/* md5-crypt - One way encryption based on MD5 sum. -Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +/* One way encryption based on MD5 sum. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include <errno.h> #include <stdlib.h> @@ -37,8 +37,11 @@ static const char b64t[64] = /* Prototypes for local functions. */ -extern char *md5_crypt_r __P ((const char *key, const char *salt, char *buffer, - int buflen)); +extern char *__md5_crypt_r __P ((const char *key, const char *salt, + char *buffer, int buflen)); +extern char *md5_crypt_r __P ((const char *key, const char *salt, + char *buffer, int buflen)); +extern char *__md5_crypt __P ((const char *key, const char *salt)); extern char *md5_crypt __P ((const char *key, const char *salt)); @@ -46,7 +49,7 @@ extern char *md5_crypt __P ((const char *key, const char *salt)); /* This entry point is equivalent to the `crypt' function in Unix libcs. */ char * -md5_crypt_r (key, salt, buffer, buflen) +__md5_crypt_r (key, salt, buffer, buflen) const char *key; const char *salt; char *buffer; @@ -155,10 +158,10 @@ md5_crypt_r (key, salt, buffer, buflen) /* Now we can construct the result string. It consists of three parts. */ - cp = stpncpy (buffer, md5_salt_prefix, MAX (0, buflen)); + cp = __stpncpy (buffer, md5_salt_prefix, MAX (0, buflen)); buflen -= sizeof (md5_salt_prefix); - cp = stpncpy (cp, salt, MIN ((size_t) buflen, salt_len)); + cp = __stpncpy (cp, salt, MIN ((size_t) buflen, salt_len)); buflen -= MIN ((size_t) buflen, salt_len); if (buflen > 0) @@ -201,10 +204,11 @@ md5_crypt_r (key, salt, buffer, buflen) return buffer; } +weak_alias (__md5_crypt_r, md5_crypt_r) char * -md5_crypt (key, salt) +__md5_crypt (key, salt) const char *key; const char *salt; { @@ -222,5 +226,6 @@ md5_crypt (key, salt) return NULL; } - return md5_crypt_r (key, salt, buffer, buflen); + return __md5_crypt_r (key, salt, buffer, buflen); } +weak_alias (__md5_crypt, md5_crypt) |