Merge pull request #170 from joshrabinowitz/detect-gpg-error-136

Detect gpg error 136
pull/178/merge
Josh Rabinowitz 6 years ago committed by GitHub
commit dff1aaf924
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -538,7 +538,7 @@ function _user_required {
local trustdb
trustdb=$(_get_secrets_dir_keys_trustdb)
local error_message="no users found. run 'git secret tell'."
local error_message="no public keys for users found. run 'git secret tell email@address'."
if [[ ! -f "$trustdb" ]]; then
_abort "$error_message"
fi
@ -548,6 +548,13 @@ function _user_required {
local keys_exist
keys_exist=$($gpg_local -n --list-keys)
local exit_code=$?
if [[ "$exit_code" -ne 0 ]]; then
# this might catch corner case where gpg --list-keys shows
# 'gpg: skipped packet of type 12 in keybox' warnings but succeeds?
# See #136
_abort "problem listing public keys in gpg: exit code $exit_code"
fi
if [[ -z "$keys_exist" ]]; then
_abort "$error_message"
fi

@ -42,6 +42,10 @@ function reveal {
# The parameters are: filename, write-to-file, force, homedir, passphrase
_decrypt "$path" "1" "$force" "$homedir" "$passphrase"
if [[ ! -f "$path" ]]; then
_abort "cannot find decrypted version of file: $filename"
fi
counter=$((counter+1))
done < "$path_mappings"

Loading…
Cancel
Save