diff options
author | ivan <ivan> | 2011-06-08 22:58:18 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-06-08 22:58:18 +0000 |
commit | 171b9af511fb12d03760e6643542b68ae4babb41 (patch) | |
tree | e72e5c3790484dc277a4677208031f3bb18c8cc4 | |
parent | 528fac78e910fc7cf0dae1e5469d385c898cf373 (diff) |
pad LDAP base64-encoded md5 and sha1 passwords to 4 byte boundries with =, RT#13192
-rw-r--r-- | FS/FS/svc_acct.pm | 2 |
1 files changed, 2 insertions, 0 deletions
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' |