From 4ef78ff58fca3f028efeb68d37a655cd9a7fce47 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Wed, 11 Nov 2015 17:50:27 +0000 Subject: [PATCH] Merged 5.0.2-CLOUD42 (Cloud ) to 5.1.N (5.1.1) 117243 adavis: Merged 5.0.2-CLOUD (Cloud ) to 5.0.2-CLOUD42 (Cloud ) 114512 adavis: Merged BCRYPT to 5.0.2-CLOUD (PARTIAL MERGE) 113778 gcornwell: MNT-14892: Fixed tests git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@117335 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../authentication/AuthenticationComponentImpl.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/java/org/alfresco/repo/security/authentication/AuthenticationComponentImpl.java b/source/java/org/alfresco/repo/security/authentication/AuthenticationComponentImpl.java index 38bd5204cd..e4a7e9939c 100644 --- a/source/java/org/alfresco/repo/security/authentication/AuthenticationComponentImpl.java +++ b/source/java/org/alfresco/repo/security/authentication/AuthenticationComponentImpl.java @@ -112,16 +112,12 @@ public class AuthenticationComponentImpl extends AbstractAuthenticationComponent if (userDetails instanceof RepositoryAuthenticatedUser) { List hashIndicator = ((RepositoryAuthenticatedUser)userDetails).getHashIndicator(); - String preferredEncoding = passwordEncoder.getPreferredEncoding(); if (hashIndicator != null && !hashIndicator.isEmpty()) { - // get the last encoding in the chain - String currentEncoding = hashIndicator.get(hashIndicator.size()-1); - // if the encoding chain is longer than 1 (double hashed) or the // current encoding is not the preferred encoding then re-generate - if (hashIndicator.size() > 1 || !currentEncoding.equals(preferredEncoding)) + if (hashIndicator.size() > 1 || !passwordEncoder.lastEncodingIsPreferred(hashIndicator)) { // add transaction listener to re-hash the users password HashPasswordTransactionListener txListener = new HashPasswordTransactionListener(userName, password);