From 9fd83c37bbabc83b1ae52af9295793b7dbc9fea3 Mon Sep 17 00:00:00 2001 From: "bzrmirror%bugzilla.org" Date: Mon, 12 May 2014 17:45:45 +0000 Subject: [PATCH] Bug 1003852: Digest::SHA 5.82 and newer always croak on wide characters, preventing users with Unicode passwords from logging in r/a=glob git-svn-id: svn://10.0.0.236/trunk@265398 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/.gitrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/Util.pm | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 950c1219d7d..9d2502be72b 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -9028 \ No newline at end of file +9029 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/.gitrev b/mozilla/webtools/bugzilla/.gitrev index ab3fa0a7a48..426fde5e907 100644 --- a/mozilla/webtools/bugzilla/.gitrev +++ b/mozilla/webtools/bugzilla/.gitrev @@ -1 +1 @@ -70e8ab711072845b5a39394268e70a88729e9d9a \ No newline at end of file +d694e688d2b129e6091ee5045066f09f4578f14e \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/Util.pm b/mozilla/webtools/bugzilla/Bugzilla/Util.pm index 9bcb6962d18..4f0711b7e0c 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Util.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Util.pm @@ -624,13 +624,13 @@ sub bz_crypt { $algorithm = $1; } + # Wide characters cause crypt and Digest to die. + if (Bugzilla->params->{'utf8'}) { + utf8::encode($password) if utf8::is_utf8($password); + } + my $crypted_password; if (!$algorithm) { - # Wide characters cause crypt to die - if (Bugzilla->params->{'utf8'}) { - utf8::encode($password) if utf8::is_utf8($password); - } - # Crypt the password. $crypted_password = crypt($password, $salt); }