From 7fff2b662773b5f47e3fd00410dbb5c17e8ef7a0 Mon Sep 17 00:00:00 2001 From: Mark Rogers Date: Wed, 23 Jul 2014 15:55:56 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud) 77145: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 73891: ACE-1821 - Stop Using MD4 for password encryption on Cloud git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@78001 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../authentication-services-context.xml | 3 + .../NoOpPasswordEncoderImpl.java | 59 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 source/java/org/alfresco/repo/security/authentication/NoOpPasswordEncoderImpl.java diff --git a/config/alfresco/authentication-services-context.xml b/config/alfresco/authentication-services-context.xml index 1d50de9eed..46ebf00c5c 100644 --- a/config/alfresco/authentication-services-context.xml +++ b/config/alfresco/authentication-services-context.xml @@ -149,6 +149,9 @@ + + + 256 diff --git a/source/java/org/alfresco/repo/security/authentication/NoOpPasswordEncoderImpl.java b/source/java/org/alfresco/repo/security/authentication/NoOpPasswordEncoderImpl.java new file mode 100644 index 0000000000..5816c33219 --- /dev/null +++ b/source/java/org/alfresco/repo/security/authentication/NoOpPasswordEncoderImpl.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2014-2014 Alfresco Software Limited. + * + * This file is part of Alfresco + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ +package org.alfresco.repo.security.authentication; + +import net.sf.acegisecurity.providers.encoding.BaseDigestPasswordEncoder; + + +/** + *

+ * NoOp implementation of PasswordEncoder. + *

+ * The No Op Password Encoder produces a blank hash. And will not match any value of hash. + * Used to replace an obsolete encoder like the MD4. + *

+ */ +public class NoOpPasswordEncoderImpl extends BaseDigestPasswordEncoder implements MD4PasswordEncoder +{ + + public NoOpPasswordEncoderImpl() + { + super(); + // TODO Auto-generated constructor stub + } + + // ~ Methods + // ================================================================ + + public boolean isPasswordValid(String encPass, String rawPass, Object salt) + { + return false; + } + + public String encodePassword(String rawPass, Object salt) + { + return ""; + } + + public byte[] decodeHash(String encodedHash) + { + return new byte[0]; + } + +}