Skip to content

Commit 46a625c

Browse files
committed
Close ESAPI#287.
1 parent 7943011 commit 46a625c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/owasp/esapi/reference/FileBasedAuthenticator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ String getHashedPassword(User user) {
161161
* Set the specified User's old password hashes. This will not set the User's current password hash.
162162
*
163163
* @param user the User whose old password hashes will be set
164-
* @param oldHashes a list of the User's old password hashes *
164+
* @param oldHashes a list of the User's old password hashes
165165
*/
166166
void setOldPasswordHashes(User user, List<String> oldHashes) {
167167
List<String> hashes = getAllHashedPasswords(user, true);
168168
if (hashes.size() > 1) {
169-
hashes.removeAll(hashes.subList(1, hashes.size() - 1));
169+
hashes.removeAll(hashes.subList(1, hashes.size()));
170170
}
171171
hashes.addAll(oldHashes);
172172
}
@@ -205,7 +205,7 @@ List<String> getAllHashedPasswords(User user, boolean create) {
205205
List<String> getOldPasswordHashes(User user) {
206206
List<String> hashes = getAllHashedPasswords(user, false);
207207
if (hashes.size() > 1) {
208-
return Collections.unmodifiableList(hashes.subList(1, hashes.size() - 1));
208+
return Collections.unmodifiableList(hashes.subList(1, hashes.size()));
209209
}
210210
return Collections.emptyList();
211211
}

0 commit comments

Comments
 (0)