Merge pull request #301 from Narrat/small_things

Small things
This commit is contained in:
Jaromil 2018-01-09 10:42:40 +01:00 committed by GitHub
commit f42a4c2a0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
tomb
View File

@ -1359,16 +1359,15 @@ gen_key() {
# prints an array of ciphers available in gnupg (to encrypt keys)
list_gnupg_ciphers() {
# prints an error if GnuPG is not found
which gpg 2>/dev/null || _failure "gpg (GnuPG) is not found, Tomb cannot function without it."
# On gpg1 and gpg2 line 10 always point to available ciphers.
# Print those until the next section is found
ciphers=(`gpg --version | awk '
BEGIN { ciphers=0 }
/^Cipher:/ { gsub(/,/,""); sub(/^Cipher:/,""); print; ciphers=1; next }
/^Hash:/ { ciphers=0 }
NR==11 { gsub(/,/,""); sub(/^.*:/,""); print; ciphers=1; next }
/^.*:/ { ciphers=0 }
{ if(ciphers==0) { next } else { gsub(/,/,""); print; } }
'`)
print " ${ciphers}"
print "${ciphers}"
return 1
}
@ -3106,7 +3105,7 @@ main() {
cat <<EOF
`sudo -V | head -n1`
`cryptsetup --version`
`pinentry --version`
`pinentry --version | head -n1`
`findmnt -V`
`gpg --version | head -n1` - key forging algorithms (GnuPG symmetric ciphers):
`list_gnupg_ciphers`