Only allow alphanumeric passphrases for now

We would need to sanitize the input for perl, or find a better way to do
hmac_sha256 here.
This commit is contained in:
Peter Cai 2022-10-10 16:18:30 -04:00
parent ca322277b2
commit 124a293a33
1 changed files with 1 additions and 0 deletions

View File

@ -67,6 +67,7 @@ gocrypt_init() {
if $needs_passphrase; then
echo -n "Enter passphrase: "
read -s passphrase
[[ "$passphrase" =~ [^a-zA-Z0-9\ ] ]] && gocrypt_die "Only alphanumeric characters are allowed for now"
local passphrase_confirm=""
echo
echo -n "Confirm passphrase: "