this is my life now. infinite frustration cast upon me by an evil curse \
This commit is contained in:
@@ -104,17 +104,17 @@ audit_passphrase() {
|
||||
|
||||
if [[ -z "$raw_password" ]]; then
|
||||
echo "[ERROR] No passphrase provided for validation." >&2
|
||||
exit 2
|
||||
return 2
|
||||
fi
|
||||
|
||||
if [[ -z "$check_password" ]]; then
|
||||
echo "[ERROR] No check passphrase provided for validation." >&2
|
||||
exit 2
|
||||
return 2
|
||||
fi
|
||||
|
||||
if [[ "$raw_password" != "$check_password" ]]; then
|
||||
echo "[ERROR] Passphrases do not match!" >&2
|
||||
exit 2
|
||||
return 2
|
||||
fi
|
||||
|
||||
unset check_password
|
||||
@@ -125,7 +125,7 @@ audit_passphrase() {
|
||||
local pass_len="${#raw_password}"
|
||||
if [ "$pass_len" -lt 35 ]; then
|
||||
echo "❌ REJECTED: Passphrase is too short ($pass_len characters). Minimum length required is 35."
|
||||
exit 1
|
||||
return 1
|
||||
fi
|
||||
echo " [PASS] Length verification satisfied ($pass_len characters)."
|
||||
|
||||
@@ -142,7 +142,7 @@ audit_passphrase() {
|
||||
|
||||
if [[ "$cracklib_result" != "OK" ]]; then
|
||||
echo "❌ REJECTED by cracklib-check: $cracklib_result"
|
||||
exit 1
|
||||
return 1
|
||||
fi
|
||||
echo " [PASS] Local dictionary and structural complexity audit clear."
|
||||
fi
|
||||
@@ -160,7 +160,7 @@ audit_passphrase() {
|
||||
|
||||
if ! response=$(curl -s -H "User-Agent: Bash-Passphrase-Audit-Script" "$api_url"); then
|
||||
echo "[FATAL] Failed to communicate with HIBP API." >&2
|
||||
exit 3
|
||||
return 3
|
||||
fi
|
||||
|
||||
local match
|
||||
@@ -170,7 +170,7 @@ audit_passphrase() {
|
||||
local pwn_count
|
||||
pwn_count=$(echo "$match" | cut -d':' -f2 | tr -d $'\r')
|
||||
echo "❌ VULNERABLE: This passphrase has appeared in $pwn_count known public breaches."
|
||||
exit 1
|
||||
return 1
|
||||
else
|
||||
echo "✅ SUCCESS: Passphrase meets all local criteria and was not found in HIBP records."
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user