Changeset - 49636b8721b9
[Not reviewed]
0 1 0
Branko Majic (branko) - 4 years ago 2020-06-29 04:17:51
branko@majic.rs
Renamed the recipients variable. Added one more variable that contains recipients solely.
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
openpgp/gitprotect.sh
Show inline comments
 
@@ -295,7 +295,8 @@ elif [[ $command = "encrypt" ]]; then
 
    while read key_validity key_id key_capabilities; do
 
        # Only use non-expired sub-keys that have encryption capability.
 
        if [[ $key_validity != e && $key_capabilities =~ .*e.* ]]; then
 
            recipients+=("-r" "$key_id")
 
            recipients+=("$key_id")
 
            recipientArgs+=("-r" "$key_id")
 
        fi
 
    done < <(gpg2 "${gnupgArgs[@]}" --list-public-keys --with-colons | grep '^sub' | awk 'BEGIN { FS = ":" } ; { print $2, $5, $12 }')
 

	
 
@@ -318,7 +319,7 @@ elif [[ $command = "encrypt" ]]; then
 
        # The file was changed, so we need to encrypt new version of it.
 
        else
 
            cat "$filePath" | gpg2 --trust-model always "${gnupgArgs[@]}" \
 
                --armor "${recipients[@]}" --encrypt > "${filename}.gpg"
 
                --armor "${recipientArgs[@]}" --encrypt > "${filename}.gpg"
 
            sha256sum "decrypted/$filename" > "decrypted/.${filename}.sha256"
 
        fi
 
    done < <(find "decrypted/" -maxdepth 1 -type f ! -name '.*.sha256')
0 comments (0 inline, 0 general)