Skip to content
Snippets Groups Projects
Commit 1b7d6a79 authored by Vitor Massaru Iha's avatar Vitor Massaru Iha Committed by Damien George
Browse files

esp8266/modules/webrepl_setup: Add info about allowed password length.

This patch also makes the code more concise by combining the checks for the
password length.
parent b1457db0
No related branches found
No related tags found
No related merge requests found
...@@ -17,12 +17,9 @@ def getpass(prompt): ...@@ -17,12 +17,9 @@ def getpass(prompt):
def input_pass(): def input_pass():
while 1: while 1:
passwd1 = getpass("New password: ") passwd1 = getpass("New password (4-9 chars): ")
if len(passwd1) < 4: if len(passwd1) < 4 or len(passwd1) > 9:
print("Password too short") print("Invalid password length")
continue
elif len(passwd1) > 9:
print("Password too long")
continue continue
passwd2 = getpass("Confirm password: ") passwd2 = getpass("Confirm password: ")
if passwd1 == passwd2: if passwd1 == passwd2:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment