From 26ca778dd161787a1ed6ee63115bf1bfdc3f79a0 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Sat, 23 May 2026 11:44:19 -0600 Subject: [PATCH] this is my life now. infinite frustration cast upon me by an evil curse \ --- create-attributable-archive.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/create-attributable-archive.sh b/create-attributable-archive.sh index dcea662..6d07423 100755 --- a/create-attributable-archive.sh +++ b/create-attributable-archive.sh @@ -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