md5c-test.c 417 B

12345678910111213141516171819
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <crypt.h>
  5. int
  6. main (int argc, char *argv[])
  7. {
  8. const char salt[] = "$1$saltstring";
  9. char *cp;
  10. cp = crypt ("Hello world!", salt);
  11. if (strcmp ("$1$saltstri$YMyguxXMBpd2TEZ.vS/3q1", cp)) {
  12. fprintf(stderr, "Failed md5 crypt test!\n");
  13. return EXIT_FAILURE;
  14. }
  15. fprintf(stderr, "Passed md5 crypt test!\n");
  16. return EXIT_SUCCESS;
  17. }