@Test public void testShiro1HashFormat() { String password = "admin123"; String shiro1Hash = "$shiro1$SHA-512$1024$zjU1u+Zg9UNwuB+HEawvtA==$IzF/OWzJxrqvB5FCe/2+UcZhhZYM2pTu0TEz7Ybnk65AbbEdUk9ntdtBzkN8P3gZby2qz6MHKqAe8Cjai9c4Gg=="; assertThat(underTest.passwordsMatch(password, shiro1Hash), is(true)); }
@Override public boolean passwordsMatch(final Object submittedPlaintext, final String encrypted) { return passwordService.passwordsMatch(submittedPlaintext, encrypted) || legacyPasswordService.passwordsMatch(submittedPlaintext, encrypted); }
DefaultSecurityPasswordService implements HashingPasswordService { @Override public boolean passwordsMatch(final Object submittedPlaintext, final String encrypted) { return passwordService.passwordsMatch(submittedPlaintext, encrypted) || legacyPasswordService.passwordsMatch(submittedPlaintext, encrypted); } }
DefaultSecurityPasswordService implements HashingPasswordService { @Override public boolean passwordsMatch(final Object submittedPlaintext, final String encrypted) { return passwordService.passwordsMatch(submittedPlaintext, encrypted) || legacyPasswordService.passwordsMatch(submittedPlaintext, encrypted); } @Inject  DefaultSecurityPasswordService(@Named("legacy") final PasswordService legacyPasswordService); }
DefaultSecurityPasswordService implements HashingPasswordService { @Override public boolean passwordsMatch(final Object submittedPlaintext, final String encrypted) { return passwordService.passwordsMatch(submittedPlaintext, encrypted) || legacyPasswordService.passwordsMatch(submittedPlaintext, encrypted); } @Inject  DefaultSecurityPasswordService(@Named("legacy") final PasswordService legacyPasswordService); @Override String encryptPassword(final Object plaintextPassword); @Override boolean passwordsMatch(final Object submittedPlaintext, final String encrypted); @Override Hash hashPassword(final Object plaintext); @Override boolean passwordsMatch(final Object plaintext, final Hash savedPasswordHash); }
DefaultSecurityPasswordService implements HashingPasswordService { @Override public boolean passwordsMatch(final Object submittedPlaintext, final String encrypted) { return passwordService.passwordsMatch(submittedPlaintext, encrypted) || legacyPasswordService.passwordsMatch(submittedPlaintext, encrypted); } @Inject  DefaultSecurityPasswordService(@Named("legacy") final PasswordService legacyPasswordService); @Override String encryptPassword(final Object plaintextPassword); @Override boolean passwordsMatch(final Object submittedPlaintext, final String encrypted); @Override Hash hashPassword(final Object plaintext); @Override boolean passwordsMatch(final Object plaintext, final Hash savedPasswordHash);  }