forked from jpmens/ppolicy-check-password
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_password.h
42 lines (34 loc) · 923 Bytes
/
check_password.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* check_password.c for OpenLDAP
*
* See LICENSE, README and INSTALL files
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <portable.h>
#include <slap.h>
#ifdef HAVE_CRACKLIB
#include <crack.h>
#endif
#if defined(DEBUG)
#include <syslog.h>
#endif
#ifndef CRACKLIB_DICTPATH
#define CRACKLIB_DICTPATH "/usr/share/cracklib/pw_dict"
#endif
#ifndef CONFIG_FILE
#define CONFIG_FILE "/etc/openldap/check_password.conf"
#endif
#define DEFAULT_QUALITY 3
#define DEFAULT_CRACKLIB 1
#define MEMORY_MARGIN 50
#define MEM_INIT_SZ 64
#define FILENAME_MAXLEN 512
#define PASSWORD_TOO_SHORT_SZ \
"Password for dn=\"%s\" is too short (%d/6)"
#define PASSWORD_QUALITY_SZ \
"Password for dn=\"%s\" does not pass required number of strength checks (%d of %d)"
#define BAD_PASSWORD_SZ \
"Bad password for dn=\"%s\" because %s"
int check_password (char *pPasswd, char **ppErrStr, Entry *pEntry);