When we read PSK from stdin, don't hide it from the user.
This commit is contained in:
parent
f62b410aaa
commit
8c7c5dba27
32
create_ap
32
create_ap
@ -1087,23 +1087,27 @@ else
|
|||||||
break
|
break
|
||||||
done
|
done
|
||||||
while :; do
|
while :; do
|
||||||
read -p "Passphrase: " -s PASSPHRASE
|
if [[ $USE_PSK -eq 0 ]]; then
|
||||||
echo
|
read -p "Passphrase: " -s PASSPHRASE
|
||||||
if [[ $USE_PSK -eq 1 ]]; then
|
echo
|
||||||
if [[ ${#PASSPHRASE} -ne 64 ]]; then
|
if [[ ${#PASSPHRASE} -gt 0 && ${#PASSPHRASE} -lt 8 ]] || [[ ${#PASSPHRASE} -gt 63 ]]; then
|
||||||
|
echo "ERROR: Invalid passphrase length ${#PASSPHRASE} (expected 8..63)" >&2
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
read -p "Retype passphrase: " -s PASSPHRASE2
|
||||||
|
echo
|
||||||
|
if [[ "$PASSPHRASE" != "$PASSPHRASE2" ]]; then
|
||||||
|
echo "Passphrases do not match."
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
read -p "PSK: " PASSPHRASE
|
||||||
|
echo
|
||||||
|
if [[ ${#PASSPHRASE} -gt 0 && ${#PASSPHRASE} -ne 64 ]]; then
|
||||||
echo "ERROR: Invalid pre-shared-key length ${#PASSPHRASE} (expected 64)" >&2
|
echo "ERROR: Invalid pre-shared-key length ${#PASSPHRASE} (expected 64)" >&2
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
elif [[ ${#PASSPHRASE} -gt 0 && ${#PASSPHRASE} -lt 8 ]] || [[ ${#PASSPHRASE} -gt 63 ]]; then
|
|
||||||
echo "ERROR: Invalid passphrase length ${#PASSPHRASE} (expected 8..63)" >&2
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
read -p "Retype passphrase: " -s PASSPHRASE2
|
|
||||||
echo
|
|
||||||
if [[ "$PASSPHRASE" != "$PASSPHRASE2" ]]; then
|
|
||||||
echo "Passphrases do not match."
|
|
||||||
else
|
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user