3 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <ac/stdlib.h>
14 #include <ac/signal.h>
15 #include <ac/socket.h>
16 #include <ac/string.h>
30 static struct berval pw[] = {
31 { sizeof("secret")-1, "secret" },
32 { sizeof("binary\0secret")-1, "secret\0binary" },
37 main( int argc, char *argv[] )
40 struct berval *passwd;
42 for( i= 0; hash[i]; i++ ) {
43 for( j = 0; pw[j].bv_len; j++ ) {
44 passwd = lutil_passwd_generate( &pw[j], hash[i] );
45 rc = lutil_passwd( passwd, &pw[j], NULL );
47 printf("%s (%d): %s (%d) %s\n",
48 pw[j].bv_val, pw[j].bv_len, passwd->bv_val, passwd->bv_len,
49 rc == 0 ? "OKAY" : "BAD" );