From 63f791d30309ea038012a135de693721f57edd0f Mon Sep 17 00:00:00 2001 From: Geoff Keating Date: Tue, 29 Feb 2000 05:21:42 +0000 Subject: * Makeconfig (all-subdirs): Add 'crypt' subdirectory. * sysdeps/unix/sysv/linux/configure.in (inhibit_glue): Don't complain if there is no crypt add-on. * crypt/configure: Removed. * crypt/crypt.texi: Update documentation of US export restrictions to match the 14 Jan 2000 regulations. 2000-02-28 Geoff Keating * Makeconfig (all-subdirs): Add 'crypt' subdirectory. * sysdeps/unix/sysv/linux/configure.in (inhibit_glue): Don't complain if there is no crypt add-on. * crypt/configure: Removed. * crypt/crypt.texi: Update documentation of US export restrictions to match the 14 Jan 2000 regulations. 2000-02-28 Geoff Keating * crypt: New subdirectory, merged in from the crypt add-on. --- crypt/examples/testpass.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 crypt/examples/testpass.c (limited to 'crypt/examples/testpass.c') diff --git a/crypt/examples/testpass.c b/crypt/examples/testpass.c new file mode 100644 index 0000000000..5bd616d2a0 --- /dev/null +++ b/crypt/examples/testpass.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include + +int +main(void) +{ + /* Hashed form of "GNU libc manual". */ + const char *const pass = "$1$/iSaq7rB$EoUw5jJPPvAPECNaaWzMK/"; + + char *result; + int ok; + +/*@group*/ + /* Read in the user's password and encrypt it, + passing the expected password in as the salt. */ + result = crypt(getpass("Password:"), pass); +/*@end group*/ + + /* Test the result. */ + ok = strcmp (result, pass) == 0; + + puts(ok ? "Access granted." : "Access denied."); + return ok ? 0 : 1; +} -- cgit v1.2.3-70-g09d2