whitespace cleanup and correct indentation to 4 spaces (no tabs)

This commit is contained in:
Jaromil 2014-11-23 18:25:42 +01:00
parent aba0fa5191
commit 99581a5faa

136
tomb
View File

@ -499,60 +499,60 @@ dump_secrets() {
# {{{ Commandline interaction # {{{ Commandline interaction
usage() { usage() {
_print "Syntax: tomb [options] command [arguments]" _print "Syntax: tomb [options] command [arguments]"
_print "\000" _print "\000"
_print "Commands:" _print "Commands:"
_print "\000" _print "\000"
_print " // Creation:" _print " // Creation:"
_print " dig create a new empty TOMB file of size -s in MB" _print " dig create a new empty TOMB file of size -s in MB"
_print " forge create a new KEY file and set its password" _print " forge create a new KEY file and set its password"
_print " lock installs a lock on a TOMB to use it with KEY" _print " lock installs a lock on a TOMB to use it with KEY"
_print "\000" _print "\000"
_print " // Operations on tombs:" _print " // Operations on tombs:"
_print " open open an existing TOMB" _print " open open an existing TOMB"
_print " index update the search indexes of tombs" _print " index update the search indexes of tombs"
_print " search looks for filenames matching text patterns" _print " search looks for filenames matching text patterns"
_print " list list of open TOMBs and information on them" _print " list list of open TOMBs and information on them"
_print " close close a specific TOMB (or 'all')" _print " close close a specific TOMB (or 'all')"
_print " slam slam a TOMB killing all programs using it" _print " slam slam a TOMB killing all programs using it"
[[ $RESIZER == 1 ]] && { [[ $RESIZER == 1 ]] && {
_print " resize resize a TOMB to a new size -s (can only grow)" _print " resize resize a TOMB to a new size -s (can only grow)"
} }
_print "\000" _print "\000"
_print " // Operations on keys:" _print " // Operations on keys:"
_print " passwd change the password of a KEY (needs old pass)" _print " passwd change the password of a KEY (needs old pass)"
_print " setkey change the KEY locking a TOMB (needs old key and pass)" _print " setkey change the KEY locking a TOMB (needs old key and pass)"
_print "\000" _print "\000"
[[ $QRENCODE == 1 ]] && { [[ $QRENCODE == 1 ]] && {
_print " // Backup on paper:" _print " // Backup on paper:"
_print " engrave makes a QR code of a KEY to be saved on paper" _print " engrave makes a QR code of a KEY to be saved on paper"
} }
_print "\000" _print "\000"
[[ $STEGHIDE == 1 ]] && { [[ $STEGHIDE == 1 ]] && {
_print " // Steganography:" _print " // Steganography:"
_print " bury hide a KEY inside a JPEG image (for use with -k)" _print " bury hide a KEY inside a JPEG image (for use with -k)"
_print " exhume extract a KEY from a JPEG image (prints to stdout)" _print " exhume extract a KEY from a JPEG image (prints to stdout)"
} }
_print "\000" _print "\000"
_print "Options:" _print "Options:"
_print "\000" _print "\000"
_print " -s size of the tomb file when creating/resizing one (in MB)" _print " -s size of the tomb file when creating/resizing one (in MB)"
_print " -k path to the key to be used ('-k -' to read from stdin)" _print " -k path to the key to be used ('-k -' to read from stdin)"
_print " -n don't process the hooks found in tomb" _print " -n don't process the hooks found in tomb"
_print " -o mount options used to open (default: rw,noatime,nodev)" _print " -o mount options used to open (default: rw,noatime,nodev)"
_print " -f force operation (i.e. even if swap is active)" _print " -f force operation (i.e. even if swap is active)"
[[ $KDF == 1 ]] && { [[ $KDF == 1 ]] && {
_print " --kdf generate passwords armored against dictionary attacks" _print " --kdf generate passwords armored against dictionary attacks"
} }
_print "\000" _print "\000"
_print " -h print this help" _print " -h print this help"
_print " -v print version, license and list of available ciphers" _print " -v print version, license and list of available ciphers"
_print " -q run quietly without printing informations" _print " -q run quietly without printing informations"
_print " -D print debugging information at runtime" _print " -D print debugging information at runtime"
_print "\000" _print "\000"
_print "For more informations on Tomb read the manual: man tomb" _print "For more informations on Tomb read the manual: man tomb"
_print "Please report bugs on <http://github.com/dyne/tomb/issues>." _print "Please report bugs on <http://github.com/dyne/tomb/issues>."
} }
@ -882,7 +882,7 @@ gpg_decrypt() {
# Gets a key file and a password, prints out the decoded contents to # Gets a key file and a password, prints out the decoded contents to
# be used directly by Luks as a cryptographic key # be used directly by Luks as a cryptographic key
get_lukskey() { get_lukskey() {
# $1 is the password # $1 is the password
_verbose "get_lukskey" _verbose "get_lukskey"
_password="$1" _password="$1"
@ -1029,8 +1029,8 @@ change_passwd() {
# takes care to encrypt a key # takes care to encrypt a key
# honored options: --kdf --tomb-pwd -o # honored options: --kdf --tomb-pwd -o
gen_key() { gen_key() {
# $1 the password to use, if not set then ask user # $1 the password to use, if not set then ask user
# -o is the --cipher-algo to use (string taken by GnuPG) # -o is the --cipher-algo to use (string taken by GnuPG)
local algopt="`option_value -o`" local algopt="`option_value -o`"
local algo="${algopt:-AES256}" local algo="${algopt:-AES256}"
# here user is prompted for key password # here user is prompted for key password
@ -2434,7 +2434,7 @@ main() {
subcommands_opts[source]="" subcommands_opts[source]=""
subcommands_opts[resize]="-ignore-swap s: -size=s k: -tomb-pwd: " subcommands_opts[resize]="-ignore-swap s: -size=s k: -tomb-pwd: "
subcommands_opts[check]="-ignore-swap " subcommands_opts[check]="-ignore-swap "
# subcommands_opts[translate]="" # subcommands_opts[translate]=""
### Detect subcommand ### Detect subcommand
local -aU every_opts #every_opts behave like a set; that is, an array with unique elements local -aU every_opts #every_opts behave like a set; that is, an array with unique elements
@ -2649,32 +2649,32 @@ main() {
# Default operation: presentation, or version information with -v # Default operation: presentation, or version information with -v
__default) __default)
_print "Tomb ::1 version:: - a strong and gentle undertaker for your secrets" $VERSION _print "Tomb ::1 version:: - a strong and gentle undertaker for your secrets" $VERSION
_print "\000" _print "\000"
_print " Copyright (C) 2007-2014 Dyne.org Foundation, License GNU GPL v3+" _print " Copyright (C) 2007-2014 Dyne.org Foundation, License GNU GPL v3+"
_print " This is free software: you are free to change and redistribute it" _print " This is free software: you are free to change and redistribute it"
_print " For the latest sourcecode go to <http://dyne.org/software/tomb>" _print " For the latest sourcecode go to <http://dyne.org/software/tomb>"
_print "\000" _print "\000"
option_is_set -v && { option_is_set -v && {
_print " This source code is distributed in the hope that it will be useful," _print " This source code is distributed in the hope that it will be useful,"
_print " but WITHOUT ANY WARRANTY; without even the implied warranty of" _print " but WITHOUT ANY WARRANTY; without even the implied warranty of"
_print " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." _print " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
_print " When in need please refer to <http://dyne.org/support>." _print " When in need please refer to <http://dyne.org/support>."
_print "\000" _print "\000"
_print "System utils:" _print "System utils:"
_print "\000" _print "\000"
cat <<EOF cat <<EOF
`sudo -V | head -n1` `sudo -V | head -n1`
`cryptsetup --version` `cryptsetup --version`
`pinentry --version` `pinentry --version`
`gpg --version | head -n1` - key forging algorithms (GnuPG symmetric ciphers): `gpg --version | head -n1` - key forging algorithms (GnuPG symmetric ciphers):
`list_gnupg_ciphers` `list_gnupg_ciphers`
EOF EOF
_print "\000" _print "\000"
_print "Optional utils:" _print "Optional utils:"
_print "\000" _print "\000"
_list_optional_tools version _list_optional_tools version
return 0 return 0
} }
usage usage
;; ;;