From 171b9af511fb12d03760e6643542b68ae4babb41 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 8 Jun 2011 22:58:18 +0000 Subject: [PATCH] pad LDAP base64-encoded md5 and sha1 passwords to 4 byte boundries with =, RT#13192 --- FS/FS/svc_acct.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index c3e72092c..a901f3bbb 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -1590,6 +1590,8 @@ sub set_password { $pass = crypt($pass, $saltset[int(rand(64))].$saltset[int(rand(64))]); } # else $encryption eq 'plain', do nothing + $pass .= '=' x (4 - length($pass) % 4) #properly padded base64 + if $encryption eq 'md5' || $encryption eq 'sha1'; $pass = '{'.uc($encryption).'}'.$pass; } # else encoding eq 'plain' -- 2.11.0