Index: modules/simpletest/tests/upgrade/upgrade.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/upgrade/upgrade.test,v
retrieving revision 1.11
diff -u -p -r1.11 upgrade.test
--- modules/simpletest/tests/upgrade/upgrade.test	18 Dec 2010 06:36:00 -0000	1.11
+++ modules/simpletest/tests/upgrade/upgrade.test	28 Dec 2010 20:08:32 -0000
@@ -378,6 +378,15 @@ class BasicUpgradePath extends UpgradePa
       'pass_raw' => 'admin',
     ));
 
+    // The previous login should've triggered a password rehash, so login one
+    // more time to make sure the new hash is readable.
+    $this->drupalLogout();
+    $this->drupalLogin((object) array(
+      'uid' => 1,
+      'name' => 'admin',
+      'pass_raw' => 'admin',
+    ));
+
     // Test that the site name is correctly displayed.
     $this->assertText('Drupal 6', t('The site name is correctly displayed.'));
 
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1228
diff -u -p -r1.1228 user.module
--- modules/user/user.module	20 Dec 2010 16:27:35 -0000	1.1228
+++ modules/user/user.module	28 Dec 2010 20:08:32 -0000
@@ -2180,10 +2180,7 @@ function user_authenticate($name, $passw
 
         // Update user to new password scheme if needed.
         if (user_needs_new_hash($account)) {
-          $new_hash = user_hash_password($password);
-          if ($new_hash) {
-            user_save($account, array('pass' => $new_hash));
-          }
+          user_save($account, array('pass' => $password));
         }
       }
     }
