Code cleanup for password storage schemes.
Used AutoRefactor.
Reduced variable scopes.


PBKDF2PasswordStorageScheme.java:
Extracted methods getDigestBytes(), encodeAndMatch(),
Removed unnecessary use of StringBuilders.
In passwordMatches() and authPasswordMatches(), used String.indexOf().

PKCS5S2PasswordStorageScheme.java:
See general changes.

PKCS5S2PasswordStorageSchemeTestCase.java:
In getTestPasswords(), reused the super method and filtered entries.
Fix test failures with Java 6 due to limitation in JDK.


git-svn-id: https://svn.forgerock.org/opendj/branches/opendj3-server-dev@10997 41b1ffd8-f28e-4786-ab96-9950f0a78031
CR-4097 Big code cleanup of some storage schemes.

PBKDF2PasswordStorageScheme.java, PKCS5S2PasswordStorageScheme.java:
Fixed a bug in PBKF2 + PKCS5S2 encodeOffline() methods which did not know how to deal with a byte[]. The right way was to wrap it in a ByteString like SaltedSHA1PasswordStorageScheme was already doing. BTW these encodeOffline() methods are never called from production code.
Did more code factorization.
Removed dead code in both with plainPlusSalt local variable which was not used for anything.
Fixed a few bugs in PKCS5S2 where locks where not properly taken (or carefully avoided?).
Made both PBKF2 + PKCS5S2 code look very similar now.

PBKDF2PasswordStorageSchemeTestCase.java, PKCS5S2PasswordStorageSchemeTestCase.java, PasswordStorageSchemeTestCase.java, SaltedSHA1PasswordStorageSchemeTestCase.java, SaltedSHA256PasswordStorageSchemeTestCase.java, SaltedSHA384PasswordStorageSchemeTestCase.java, SaltedSHA512PasswordStorageSchemeTestCase.java:
Removed dead code.

CryptPasswordStorageSchemeTestCase.java:
Made it reuse more code from PasswordStorageSchemeTestCase.


git-svn-id: https://svn.forgerock.org/opendj/branches/opendj3-server-dev@10998 41b1ffd8-f28e-4786-ab96-9950f0a78031