| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2010 ForgeRock AS. |
| | | * Portions Copyright 2010-2013 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | | finally |
| | | { |
| | | Arrays.fill(plainPlusSalt, (byte) 0); |
| | | } |
| | | } |
| | | |
| | | // Append the salt to the hashed value and base64-the whole thing. |
| | |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | | finally |
| | | { |
| | | Arrays.fill(plainPlusSalt, (byte) 0); |
| | | } |
| | | } |
| | | |
| | | // Append the salt to the hashed value and base64-the whole thing. |
| | |
| | | |
| | | return false; |
| | | } |
| | | finally |
| | | { |
| | | Arrays.fill(plainPlusSalt, (byte) 0); |
| | | } |
| | | } |
| | | |
| | | return Arrays.equals(digestBytes, userDigestBytes); |
| | |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | | finally |
| | | { |
| | | Arrays.fill(plainPlusSalt, (byte) 0); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | synchronized (digestLock) |
| | | { |
| | | return Arrays.equals(digestBytes, |
| | | messageDigest.digest(plainPlusSaltBytes)); |
| | | try |
| | | { |
| | | return Arrays.equals(digestBytes, |
| | | messageDigest.digest(plainPlusSaltBytes)); |
| | | } |
| | | finally |
| | | { |
| | | Arrays.fill(plainPlusSaltBytes, (byte) 0); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | System.arraycopy(digestBytes, 0, digestPlusSalt, 0, digestBytes.length); |
| | | System.arraycopy(saltBytes, 0, digestPlusSalt, digestBytes.length, |
| | | NUM_SALT_BYTES); |
| | | Arrays.fill(passwordPlusSalt, (byte) 0); |
| | | |
| | | return "{" + STORAGE_SCHEME_NAME_SALTED_SHA_512 + "}" + |
| | | Base64.encode(digestPlusSalt); |