summaryrefslogtreecommitdiff
path: root/test-crypt-md5.c
blob: a93fcc1614903030ee04423117a17b995515e119 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "crypt-port.h"
#include "crypt-base.h"

#include <string.h>

int
main (void)
{
  struct crypt_data output;
  const char salt[] = "$1$saltstring";
  char *cp;
  int result = 0;

  cp = crypt_r ("Hello world!", salt, &output);
  if (cp == 0)
    return 1;

  result |= strcmp ("$1$saltstri$YMyguxXMBpd2TEZ.vS/3q1", cp);

  return result;
}