From eda3bd18fcff1e7d354bd574b6add4cac2b513e9 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Huynh Date: Thu, 10 Dec 2015 09:59:04 +0000 Subject: [PATCH] Merged 5.1-MC1 (5.1.0) to HEAD (5.1) 119053 adavis: Merged 5.1.N (5.1.1) to 5.1-MC1 (5.1.0) 117335 adavis: 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/HEAD/root@119891 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);