From d0ffe11bd365b68d4da252b39d06d99f75d8cacb Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Wed, 16 Nov 2022 23:14:10 +0100 Subject: minor cleanup and fixes --- lib/JWebmail/Plugin/Helper.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/JWebmail/Plugin/Helper.pm') 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 { -- cgit v1.2.3