1 |
diff -Nur -x '*.orig' -x '*.rej' cpu-1.4.3/src/include/util/hash.h mezzanine_patched_cpu-1.4.3/src/include/util/hash.h |
2 |
--- cpu-1.4.3/src/include/util/hash.h 2003-09-26 22:27:01.000000000 -0400 |
3 |
+++ mezzanine_patched_cpu-1.4.3/src/include/util/hash.h 2007-07-24 15:26:10.000000000 -0400 |
4 |
@@ -49,12 +49,14 @@ |
5 |
#define PASSWORD_SIZE 128 |
6 |
|
7 |
/* hash_t should have a one-to-one correspondence with hashes */ |
8 |
+/* HVB added H_MD5CRYPT */ |
9 |
typedef enum { |
10 |
H_SHA1 = 0, |
11 |
H_SSHA1, |
12 |
H_MD5, |
13 |
H_SMD5, |
14 |
H_CRYPT, |
15 |
+ H_MD5CRYPT, |
16 |
H_CLEAR, |
17 |
H_UNKNOWN, |
18 |
} hash_t; |
19 |
diff -Nur -x '*.orig' -x '*.rej' cpu-1.4.3/src/plugins/ldap/ld.c mezzanine_patched_cpu-1.4.3/src/plugins/ldap/ld.c |
20 |
--- cpu-1.4.3/src/plugins/ldap/ld.c 2007-07-24 15:26:53.000000000 -0400 |
21 |
+++ mezzanine_patched_cpu-1.4.3/src/plugins/ldap/ld.c 2007-07-24 15:26:10.000000000 -0400 |
22 |
@@ -478,6 +478,9 @@ |
23 |
case H_CRYPT: |
24 |
return ldap_hashes[H_CRYPT]; |
25 |
break; |
26 |
+ case H_MD5CRYPT: /* HvB */ |
27 |
+ return ldap_hashes[H_CRYPT]; |
28 |
+ break; |
29 |
case H_CLEAR: |
30 |
/* FIXME: this should work so that the prefix is returned for the |
31 |
correct hash but the password doesn't get encrypted */ |
32 |
diff -Nur -x '*.orig' -x '*.rej' cpu-1.4.3/src/util/hash.c mezzanine_patched_cpu-1.4.3/src/util/hash.c |
33 |
--- cpu-1.4.3/src/util/hash.c 2003-10-22 17:29:19.000000000 -0400 |
34 |
+++ mezzanine_patched_cpu-1.4.3/src/util/hash.c 2007-07-24 15:26:10.000000000 -0400 |
35 |
@@ -50,6 +50,7 @@ |
36 |
"md5", |
37 |
"smd5", |
38 |
"crypt", |
39 |
+ "md5crypt", |
40 |
"clear", |
41 |
NULL |
42 |
}; |
43 |
@@ -140,6 +141,11 @@ |
44 |
char * passphrase = NULL; |
45 |
size_t plen = 0; |
46 |
|
47 |
+ /* |
48 |
+ * HvB |
49 |
+ */ |
50 |
+ char md5salt[32]; |
51 |
+ |
52 |
if ( password == NULL ) |
53 |
return NULL; |
54 |
|
55 |
@@ -185,9 +191,20 @@ |
56 |
fprintf(stderr, "Your c library is missing 'crypt'\n"); |
57 |
#endif |
58 |
break; |
59 |
+ |
60 |
+ case H_MD5CRYPT: /* HvB */ |
61 |
+#ifdef HAVE_LIBCRYPT |
62 |
+ snprintf(md5salt, sizeof(md5salt),"$1$%s", cgetSalt()); |
63 |
+ temp = crypt(password, md5salt); |
64 |
+#else |
65 |
+ fprintf(stderr, "Your c library is missing 'crypt'\n"); |
66 |
+#endif |
67 |
+ break; |
68 |
+ |
69 |
case H_CLEAR: |
70 |
temp = password; |
71 |
break; |
72 |
+ |
73 |
default: |
74 |
fprintf(stderr, "getHash: Unknown hash type.\n"); |
75 |
return NULL; |