Commits

Erik Grinaker committed 8e465cb

do password entropy and palindrome tests after strength test

Comments (0)

Files changed (1)

 		raise ValueError, "isn't varied enough"
 
 
-	# check for entropy
-	if entropy(password) / entropy_ideal(len(password)) < 0.8:
-		raise ValueError, "isn't random enough"
-
-
-	# check if the password is a palindrome
-	for i in range(len(password)):
-		if password[i] != password[-i - 1]:
-			break
-
-	else:
-		raise ValueError, "is a palindrome"
-
-
 	# check the password strength
 	limit		= 10
 	cred_lower	= 1.1
 		raise ValueError, "is too weak"
 
 
+	# check for entropy
+	if entropy(password) / entropy_ideal(len(password)) < 0.8:
+		raise ValueError, "isn't random enough"
+
+
+	# check if the password is a palindrome
+	for i in range(len(password)):
+		if password[i] != password[-i - 1]:
+			break
+
+	else:
+		raise ValueError, "is a palindrome"
+
+
 	# check password with cracklib
 	try:
 		crack.FascistCheck(password)