[Schmitzm-commits] r1659 - trunk/schmitzm-core/src/main/java/de/schmitzm/crypt

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


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

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

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/crypt/HtPasswd.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/crypt/HtPasswd.java	2011-07-29 14:19:26 UTC (rev 1658)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/crypt/HtPasswd.java	2011-07-29 14:19:37 UTC (rev 1659)
@@ -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