# HG changeset patch # User sergey # Date 1352217657 -14400 # Node ID 0057f48f7945255a8409a39561fec0267bf384de # Parent 814d755e5d1231bb4f1b12b00fdf18d6574bb646 fixed simple auth package to work with utf8 strings diff -r 814d755e5d12 -r 0057f48f7945 Lib/IMPL/Security/Auth/Simple.pm --- a/Lib/IMPL/Security/Auth/Simple.pm Tue Nov 06 00:58:15 2012 +0400 +++ b/Lib/IMPL/Security/Auth/Simple.pm Tue Nov 06 20:00:57 2012 +0400 @@ -2,6 +2,7 @@ use strict; use Digest::MD5 qw(md5_hex); +use Encode qw(encode); use IMPL::Security::Auth qw(:Const); @@ -57,7 +58,7 @@ my $salt = $this->_salt; - if (md5_hex($salt, $challenge, $salt) eq $this->_image) { + if (md5_hex($salt,encode('utf-8', $challenge), $salt) eq $this->_image) { if ($this->_stage == STAGE_INIT) { $this->_stage(STAGE_DONE); } @@ -73,7 +74,7 @@ die new IMPL::InvalidArgumentException("The parameter is required",'password') unless $args{password}; my $salt = $self->GenSSID(); - return return join ('|',STAGE_INIT, $salt, md5_hex($salt,$args{password},$salt)); + return return join ('|',STAGE_INIT, $salt, md5_hex($salt,encode('utf-8', $args{password}),$salt)); } sub SecDataArgs {