1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 010-enctype-apache.dpatch by Andreas Barth <aba@not.so.argh.org>
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Provide an Apache authentication method
8 diff -urNad mod-auth-mysql~/DIRECTIVES mod-auth-mysql/DIRECTIVES
9 --- mod-auth-mysql~/DIRECTIVES 2008-05-14 16:59:28.000000000 +0200
10 +++ mod-auth-mysql/DIRECTIVES 2008-05-15 09:49:06.000000000 +0200
14 The hashing scheme used by the MySQL PASSWORD() function.
17 + The hashing scheme used by htpasswd utility. Compatible to
20 AuthMySQL_Encryption_Types <type_list>
21 Synonym for Auth_MySQL_Encryption_Types.
22 diff -urNad mod-auth-mysql~/mod_auth_mysql.c mod-auth-mysql/mod_auth_mysql.c
23 --- mod-auth-mysql~/mod_auth_mysql.c 2008-05-14 18:46:21.000000000 +0200
24 +++ mod-auth-mysql/mod_auth_mysql.c 2008-05-15 09:49:06.000000000 +0200
26 #define CRYPT_ENCRYPTION_FLAG 1<<5
28 #define SHA1SUM_ENCRYPTION_FLAG 1<<6
29 +#define APACHE_ENCRYPTION_FLAG 1<<7
31 static int check_no_encryption(const char *passwd, char *enc_passwd)
34 return (!strcmp(scrambled_passwd, enc_passwd));
37 +static int check_apache_encryption(const char *passwd, char *enc_passwd)
39 + return (!ap_validate_password(passwd, enc_passwd));
44 int (*check_function)(const char *passwd, char *enc_passwd);
46 { "Crypt", check_crypt_encryption, CRYPT_ENCRYPTION_FLAG },
47 { "PHP_MD5", check_PHP_MD5_encryption, PHP_MD5_ENCRYPTION_FLAG },
48 { "SHA1Sum", check_SHA1Sum_encryption, SHA1SUM_ENCRYPTION_FLAG},
49 + { "Apache", check_apache_encryption, APACHE_ENCRYPTION_FLAG },
50 /* add additional encryption types below */