diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2022-11-16 23:14:10 +0100 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2022-11-16 23:14:10 +0100 |
commit | d0ffe11bd365b68d4da252b39d06d99f75d8cacb (patch) | |
tree | 17b852052b6515864d7963b49b2ac3ee2c3df134 /lib/JWebmail/Plugin/Helper.pm | |
parent | a52a7d7c27440a7c2716af033a6113abcaa2bd46 (diff) |
minor cleanup and fixes
Diffstat (limited to 'lib/JWebmail/Plugin/Helper.pm')
-rw-r--r-- | lib/JWebmail/Plugin/Helper.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/JWebmail/Plugin/Helper.pm b/lib/JWebmail/Plugin/Helper.pm index 8323a61..ad5c8ad 100644 --- a/lib/JWebmail/Plugin/Helper.pm +++ b/lib/JWebmail/Plugin/Helper.pm @@ -178,8 +178,9 @@ sub session_passwd { if (length $passwd < 20) { $passwd .= "\n" . ' ' x (20 - length($passwd) - 1); } - my $rand_bytes = _rand_data(length $passwd); - $c->s3d(S_PASSWD, b64_encode(encode('UTF-8', $passwd) ^ $rand_bytes, '')); + my $passwd_utf8 = encode('UTF-8', $passwd); + my $rand_bytes = _rand_data(length $passwd_utf8); + $c->s3d(S_PASSWD, b64_encode($passwd_utf8 ^ $rand_bytes, '')); $c->session(S_OTP_S3D_PW, b64_encode($rand_bytes, '')); } else { |