2 * This program is copyright Alec Muffett 1993. The author disclaims all
3 * responsibility or liability with respect to it's usage or its effect
4 * upon hardware or computer systems, and maintains copyright as set out
5 * in the "LICENCE" document which accompanies distributions of Crack v4.0
10 * Modified as part of the krb5-strength project as follows:
12 * 2007-03-23 Russ Allbery <eagle@eyrie.org>
13 * - Add ANSI C prototypes and prototype additional functions.
14 * 2009-10-14 Russ Allbery <eagle@eyrie.org>
15 * - Prototype changes for const cleanliness.
16 * 2010-03-14 Russ Allbery <eagle@eyrie.org>
17 * - Fix int8, int16, and int32 definitions.
18 * 2013-10-01 Russ Allbery <eagle@eyrie.org>
19 * - Set hidden visibility on all symbols by default.
23 #include <portable/system.h>
27 #define STRINGSIZE 1024
28 #define TRUNCSTRINGSIZE (STRINGSIZE/4)
31 typedef uint16_t int16;
32 typedef uint32_t int32;
37 #define MAXBLOCKLEN (MAXWORDLEN * NUMWORDS)
54 #define PFOR_WRITE 0x0001
55 #define PFOR_FLUSH 0x0002
56 #define PFOR_USEHWMS 0x0004
60 struct pi_header header;
63 char data[NUMWORDS][MAXWORDLEN];
66 #define PW_WORDS(x) ((x)->header.pih_numwords)
67 #define PIH_MAGIC 0x70775631
69 /* Default to a hidden visibility for all CrackLib functions. */
70 #pragma GCC visibility push(hidden)
72 extern PWDICT *PWOpen(const char *, const char *);
73 extern int32 FindPW(PWDICT *, const char *);
74 extern int PutPW(PWDICT *, const char *);
75 extern int PWClose(PWDICT *);
76 extern char *Mangle(const char *, const char *);
77 extern const char *FascistCheck(const char *, const char *);
78 extern char Chop(char *);
79 extern char *Trim(char *);
80 extern int PMatch(const char *, const char *);
81 extern char *Reverse(const char *);
82 extern char *Lowercase(const char *);
84 /* Undo default visibility change. */
85 #pragma GCC visibility pop
87 #define CRACK_TOLOWER(a) (isupper(a)?tolower(a):(a))
88 #define CRACK_TOUPPER(a) (islower(a)?toupper(a):(a))
89 #define STRCMP(a,b) strcmp((a),(b))