summaryrefslogtreecommitdiffstats
path: root/lib/libcrypt/crypt-md5.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-12-28 10:32:02 +0000
committerpeter <peter@FreeBSD.org>2000-12-28 10:32:02 +0000
commit117ae0dab37bc1cc35a0315ff2df8e77e35977e1 (patch)
treef0d0cfdbc7bfc57a3aa8de23f9d6d7e0a7bfa0de /lib/libcrypt/crypt-md5.c
parentf49769785010468be1e939afb84ceafc62153c2c (diff)
downloadFreeBSD-src-117ae0dab37bc1cc35a0315ff2df8e77e35977e1.zip
FreeBSD-src-117ae0dab37bc1cc35a0315ff2df8e77e35977e1.tar.gz
Merge into a single US-exportable libcrypt, which only provides
one-way hash functions for authentication purposes. There is no more "set the libcrypt->libXXXcrypt" nightmare. - Undo the libmd.so hack, use -D to hide the md5c.c internals. - Remove the symlink hacks in release/Makefile - the algorthm is set by set_crypt_format() as before. If this is not called, it tries to heuristically figure out the hash format, and if all else fails, it uses the optional auth.conf entry to chose the overall default hash. - Since source has non-hidden crypto in it there may be some issues with having the source it in some countries, so preserve the "secure/*" division. You can still build a des-free libcrypt library if you want to badly enough. This should not be a problem in the US or exporting from the US as freebsd.org had notified BXA some time ago. That makes this stuff re-exportable by anyone. - For consistancy, the default in absence of any other clues is md5. This is to try and minimize POLA across buildworld where folk may suddenly be activating des-crypt()-hash support. Since the des hash may not always be present, it seemed sensible to make the stronger md5 algorithm the default. All things being equal, no functionality is lost. Reviewed-by: jkh (flame-proof suit on)
Diffstat (limited to 'lib/libcrypt/crypt-md5.c')
-rw-r--r--lib/libcrypt/crypt-md5.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/lib/libcrypt/crypt-md5.c b/lib/libcrypt/crypt-md5.c
index c112bd8..6b639cc 100644
--- a/lib/libcrypt/crypt-md5.c
+++ b/lib/libcrypt/crypt-md5.c
@@ -22,18 +22,6 @@ static const char rcsid[] = \
#include <err.h>
#include "crypt.h"
-#ifdef __PIC__
-#include <dlfcn.h>
-
-#define MD5Init(ctx) dl_MD5Init(ctx)
-#define MD5Update(ctx, data, len) dl_MD5Update(ctx, data, len)
-#define MD5Final(dgst, ctx) dl_MD5Final(dgst, ctx)
-
-static void (*dl_MD5Init)(MD5_CTX *);
-static void (*dl_MD5Update)(MD5_CTX *, const unsigned char *, unsigned int);
-static void (*dl_MD5Final)(unsigned char digest[16], MD5_CTX *);
-#endif
-
/*
* UNIX password
*/
@@ -55,9 +43,6 @@ crypt_md5(pw, salt)
int sl,pl,i;
MD5_CTX ctx,ctx1;
unsigned long l;
-#ifdef __PIC__
- void *libmd;
-#endif
/* Refine the Salt first */
sp = salt;
@@ -73,31 +58,6 @@ crypt_md5(pw, salt)
/* get the length of the true salt */
sl = ep - sp;
-#ifdef __PIC__
- libmd = dlopen("libmd.so", RTLD_NOW);
- if (libmd == NULL) {
- warnx("libcrypt-md5: dlopen(libmd.so): %s\n", dlerror());
- return NULL;
- }
- dl_MD5Init = dlsym(libmd, "MD5Init");
- if (dl_MD5Init == NULL) {
- warnx("libcrypt-md5: looking for MD5Init: %s\n", dlerror());
- dlclose(libmd);
- return NULL;
- }
- dl_MD5Update = dlsym(libmd, "MD5Update");
- if (dl_MD5Update == NULL) {
- warnx("libcrypt-md5: looking for MD5Update: %s\n", dlerror());
- dlclose(libmd);
- return NULL;
- }
- dl_MD5Final = dlsym(libmd, "MD5Final");
- if (dl_MD5Final == NULL) {
- warnx("libcrypt-md5: looking for MD5Final: %s\n", dlerror());
- dlclose(libmd);
- return NULL;
- }
-#endif
MD5Init(&ctx);
/* The password first, since that is what is most unknown */
@@ -160,9 +120,6 @@ crypt_md5(pw, salt)
MD5Final(final,&ctx1);
}
-#ifdef __PIC__
- dlclose(libmd);
-#endif
p = passwd + strlen(passwd);
l = (final[ 0]<<16) | (final[ 6]<<8) | final[12];
OpenPOWER on IntegriCloud