glibc/crypt/md5c-test.c
Alexandre Oliva e745142509 * crypt/crypt-entry.c: Include fips-private.h.
(__crypt_r, __crypt): Disable MD5 and DES if FIPS is enabled.
* crypt/md5c-test.c (main): Tolerate disabled MD5.
* sysdeps/unix/sysv/linux/fips-private.h: New file.
* sysdeps/generic/fips-private.h: New file, dummy fallback.
2012-10-10 07:05:46 -03:00

19 lines
318 B
C

#include <crypt.h>
#include <string.h>
int
main (int argc, char *argv[])
{
const char salt[] = "$1$saltstring";
char *cp;
int result = 0;
cp = crypt ("Hello world!", salt);
/* MD5 is disabled in FIPS mode. */
if (cp)
result |= strcmp ("$1$saltstri$YMyguxXMBpd2TEZ.vS/3q1", cp);
return result;
}