summaryrefslogtreecommitdiff
blob: e7f6eb31ef3f0c863c0693e483b39365ae6d8efa (plain)
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
Index: mod_auth_mysql-3.0.0/mod_auth_mysql.c
===================================================================
--- mod_auth_mysql-3.0.0.orig/mod_auth_mysql.c
+++ mod_auth_mysql-3.0.0/mod_auth_mysql.c
@@ -288,6 +288,7 @@ static short pw_crypted(POOL * pool, con
 static short pw_aes(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt);
 #endif
 static short pw_sha1(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt);
+static short pw_apr(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt);
 static short pw_plain(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt);
 
 static char * format_remote_host(request_rec * r, char ** parm);
@@ -318,7 +319,8 @@ static encryption encryptions[] = {{"cry
 #if _AES
 					   {"aes", SALT_REQUIRED, pw_aes},
 #endif
-					   {"sha1", NO_SALT, pw_sha1}};
+					   {"sha1", NO_SALT, pw_sha1},
+					   {"apr", NO_SALT, pw_apr}};
 typedef struct {		/* User formatting patterns */
   char pattern;			/* Pattern to match */
   char * (*func)(request_rec * r, char ** parm);
@@ -856,6 +858,12 @@ static short pw_sha1(POOL * pool, const 
   return  strcasecmp(bin2hex(pool, scrambled_sent_pw, enc_len), real_pw) == 0;
 }
 
+/* checks passwords from htpasswd */
+static short pw_apr(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt) {
+  /* apr_password_validate will do the job */
+  return apr_password_validate(sent_pw, real_pw) == APR_SUCCESS;
+}
+
 /* checks plain text passwords */
 static short pw_plain(POOL * pool, const char * real_pw, const char * sent_pw, const char * salt) {
   return strcmp(real_pw, sent_pw) == 0;