[Schmitzm-commits] r1658 - branches/2.5/schmitzm-core/src/main/java/de/schmitzm/crypt

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jul 29 16:19:26 CEST 2011


Author: keeb
Date: 2011-07-29 16:19:26 +0200 (Fri, 29 Jul 2011)
New Revision: 1658

Modified:
   branches/2.5/schmitzm-core/src/main/java/de/schmitzm/crypt/HtPasswd.java
Log:
Not allowing hashes that start or end with whitespace for convenience

Modified: branches/2.5/schmitzm-core/src/main/java/de/schmitzm/crypt/HtPasswd.java
===================================================================
--- branches/2.5/schmitzm-core/src/main/java/de/schmitzm/crypt/HtPasswd.java	2011-07-29 14:14:49 UTC (rev 1657)
+++ branches/2.5/schmitzm-core/src/main/java/de/schmitzm/crypt/HtPasswd.java	2011-07-29 14:19:26 UTC (rev 1658)
@@ -42,7 +42,7 @@
 				String.valueOf(new Random().nextInt(99)), 2);
 
 		String crypted = UnixCrypt.crypt(salt, cleartext);
-		while (crypted.startsWith(" ")) {
+		while (crypted.startsWith(" ") || crypted.endsWith(" ")) {
 			salt = StringUtils.leftPad(
 					String.valueOf(new Random().nextInt(99)), 2);
 			crypted = UnixCrypt.crypt(salt, cleartext);



More information about the Schmitzm-commits mailing list