summaryrefslogtreecommitdiff
path: root/test/crypt/md5c-test.c
blob: e2896b5b1355454ef788d7630418144c34e46ae1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <crypt.h>

int
main (int argc, char *argv[])
{
  const char salt[] = "$1$saltstring";
  char *cp;

  cp = crypt ("Hello world!", salt);
  if (strcmp ("$1$saltstri$YMyguxXMBpd2TEZ.vS/3q1", cp)) { 
      fprintf(stderr, "Failed md5 crypt test!\n");
      return EXIT_FAILURE;
  }
  fprintf(stderr, "Passed md5 crypt test!\n");
  return EXIT_SUCCESS;
}