Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 482340 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-16 / +16 lines)
Line  Link Here
0
-- a/lib/functions.php
0
++ b/lib/functions.php
Lines 2127-2133 Link Here
2127
 *        crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, sha512, or clear.
2127
 *        crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, sha512, or clear.
2128
 * @return string The hashed password.
2128
 * @return string The hashed password.
2129
 */
2129
 */
2130
function password_hash($password_clear,$enc_type) {
2130
function pla_password_hash($password_clear,$enc_type) {
2131
       if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
2131
       if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
2132
               debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
2132
               debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
Lines 2318-2324 Link Here
2318
               # SHA crypted passwords
2318
               # SHA crypted passwords
2319
               case 'sha':
2319
               case 'sha':
2320
                       if (strcasecmp(password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0)
2320
                       if (strcasecmp(pla_password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0)
2321
                               return true;
2321
                               return true;
2322
                       else
2322
                       else
2323
                               return false;
2323
                               return false;
Lines 2327-2333 Link Here
2327
               # MD5 crypted passwords
2327
               # MD5 crypted passwords
2328
               case 'md5':
2328
               case 'md5':
2329
                       if( strcasecmp(password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0)
2329
                       if( strcasecmp(pla_password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0)
2330
                               return true;
2330
                               return true;
2331
                       else
2331
                       else
2332
                               return false;
2332
                               return false;
Lines 2392-2398 Link Here
2392
               # SHA512 crypted passwords
2392
               # SHA512 crypted passwords
2393
               case 'sha512':
2393
               case 'sha512':
2394
                       if (strcasecmp(password_hash($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0)
2394
                       if (strcasecmp(pla_password_hash($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0)
2395
                               return true;
2395
                               return true;
2396
                       else
2396
                       else
2397
                               return false;
2397
                               return false;
2398
-- a/lib/TemplateRender.php
2398
++ b/lib/TemplateRender.php
Lines 2466-2472 Link Here
2466
               if ($val = $attribute->getValue($i))
2466
               if ($val = $attribute->getValue($i))
2467
                       $default = get_enc_type($val);
2467
                       $default = get_enc_type($val);
2468
               else
2468
               else
2469
                       $default = $this->getServer()->getValue('appearance','password_hash');
2469
                       $default = $this->getServer()->getValue('appearance','pla_password_hash');
2470
               if (! $attribute->getPostValue())
2470
               if (! $attribute->getPostValue())
2471
                       printf('<input type="hidden" name="post_value[%s][]" value="%s" />',$attribute->getName(),$i);
2471
                       printf('<input type="hidden" name="post_value[%s][]" value="%s" />',$attribute->getName(),$i);
2472
-- a/lib/PageRender.php
2472
++ b/lib/PageRender.php
Lines 287-293 Link Here
287
                                               break;
287
                                               break;
288
                                       default:
288
                                       default:
289
                                               $vals[$i] = password_hash($passwordvalue,$enc);
289
                                               $vals[$i] = pla_password_hash($passwordvalue,$enc);
290
                               }
290
                               }
291
                               $vals = array_unique($vals);
291
                               $vals = array_unique($vals);
Lines 957-963 Link Here
957
               if (trim($val))
957
               if (trim($val))
958
                       $enc_type = get_enc_type($val);
958
                       $enc_type = get_enc_type($val);
959
               else
959
               else
960
                       $enc_type = $server->getValue('appearance','password_hash');
960
                       $enc_type = $server->getValue('appearance','pla_password_hash');
961
               $obfuscate_password = obfuscate_password_display($enc_type);
961
               $obfuscate_password = obfuscate_password_display($enc_type);
Lines 982-988 Link Here
982
               if (trim($val))
982
               if (trim($val))
983
                       $enc_type = get_enc_type($val);
983
                       $enc_type = get_enc_type($val);
984
               else
984
               else
985
                       $enc_type = $server->getValue('appearance','password_hash');
985
                       $enc_type = $server->getValue('appearance','pla_password_hash');
986
               echo '<table cellspacing="0" cellpadding="0"><tr><td valign="top">';
986
               echo '<table cellspacing="0" cellpadding="0"><tr><td valign="top">';
987
-- a/lib/ds_ldap_pla.php
987
++ b/lib/ds_ldap_pla.php
Lines 16-22 Link Here
16
       function __construct($index) {
16
       function __construct($index) {
17
               parent::__construct($index);
17
               parent::__construct($index);
18
               $this->default->appearance['password_hash'] = array(
18
               $this->default->appearance['pla_password_hash'] = array(
19
                       'desc'=>'Default HASH to use for passwords',
19
                       'desc'=>'Default HASH to use for passwords',
20
                       'default'=>'md5');
20
                       'default'=>'md5');
21
-- a/config/config.php
21
++ b/config/config.php
Lines 379-385 Link Here
379
/* Default password hashing algorithm. One of md5, ssha, sha, md5crpyt, smd5,
379
/* Default password hashing algorithm. One of md5, ssha, sha, md5crpyt, smd5,
380
   blowfish, crypt or leave blank for now default algorithm. */
380
   blowfish, crypt or leave blank for now default algorithm. */
381
// $servers->setValue('appearance','password_hash','md5');
381
// $servers->setValue('appearance','pla_password_hash','md5');
382
/* If you specified 'cookie' or 'session' as the auth_type above, you can
382
/* If you specified 'cookie' or 'session' as the auth_type above, you can
383
   optionally specify here an attribute to use when logging in. If you enter
383
   optionally specify here an attribute to use when logging in. If you enter
Lines 546-552 Link Here
546
$servers->setValue('sasl','authz_id_replacement','$1');
546
$servers->setValue('sasl','authz_id_replacement','$1');
547
$servers->setValue('sasl','props',null);
547
$servers->setValue('sasl','props',null);
548
$servers->setValue('appearance','password_hash','md5');
548
$servers->setValue('appearance','pla_password_hash','md5');
549
$servers->setValue('login','attr','dn');
549
$servers->setValue('login','attr','dn');
550
$servers->setValue('login','fallback_dn',false);
550
$servers->setValue('login','fallback_dn',false);
551
$servers->setValue('login','class',null);
551
$servers->setValue('login','class',null);

Return to bug 482340