key file extension changed to .tomb.key

rename your keys !
this change was motivated by the fact gpg tends to overwrite the
.tomb file if we decrypt the tomb.gpg by hand. changing the extension
in .tomb.key this doesn't happens.
This commit is contained in:
Jaromil 2011-02-20 20:10:08 +01:00
parent f309e3f08d
commit 81be1fa619
8 changed files with 30 additions and 24 deletions

View File

@ -1,11 +1,11 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/x-tomb-volume"> <mime-type type="application/x-tomb-volume">
<comment>Tomb encrypted volume</comment> <comment>Tomb crypto volume</comment>
<glob pattern="*.tomb"/> <glob pattern="*.tomb"/>
</mime-type> </mime-type>
<mime-type type="application/x-tomb-key"> <mime-type type="application/x-tomb-key">
<comment>Tomb crypto key</comment> <comment>Tomb crypto key</comment>
<glob pattern="*.tomb.gpg"/> <glob pattern="*.tomb.key"/>
</mime-type> </mime-type>
</mime-info> </mime-info>

View File

@ -1,4 +1,4 @@
?package(tomb):command="tomb" icon="/usr/share/pixmaps/monmort.xpm" needs="cryptsetup" \ ?package(tomb):command="tomb" icon="/usr/share/pixmaps/monmort.xpm" needs="text" \
section="Applications/Accessories" title="Tomb" hints="Crypto" \ section="Applications/Accessories" title="Tomb" hints="Crypto" \
hotkey="Tomb" hotkey="Tomb"

View File

@ -3,5 +3,5 @@ tomb
name=Tomb - Crypto Undertaker name=Tomb - Crypto Undertaker
can_open_multiple_files=false can_open_multiple_files=false
expects_uris=false expects_uris=false
requires_terminal=false requires_terminal=true
mime-types=application/x-tomb-volume,application/x-tomb-key mime-types=application/x-tomb-volume,application/x-tomb-key

View File

@ -7,7 +7,7 @@ Comment=Keep your bones safe
Exec=tomb-open %U Exec=tomb-open %U
TryExec=tomb-open TryExec=tomb-open
Icon=monmort.xpm Icon=monmort.xpm
Terminal=false Terminal=true
Categories=Utility;Security;Archiving;Filesystem; Categories=Utility;Security;Archiving;Filesystem;
MimeType=application/x-tomb-volume; MimeType=application/x-tomb-volume;
X-AppInstall-Package=tomb X-AppInstall-Package=tomb

View File

@ -4,3 +4,9 @@ application/x-tomb-volume:
view=tomb-open %f view=tomb-open %f
icon-filename=monmort.xpm icon-filename=monmort.xpm
short_list_application_ids_for_novice_user_level=tomb short_list_application_ids_for_novice_user_level=tomb
application/x-tomb-key:
open=tomb-open %f
view=tomb-open %f
icon-filename=monmort.xpm
short_list_application_ids_for_novice_user_level=tomb

View File

@ -3,4 +3,4 @@ application/x-tomb-volume
ext: tomb ext: tomb
application/x-tomb-key application/x-tomb-key
ext: tomb.gpg ext: tomb.key

View File

@ -170,8 +170,8 @@ get_arg_tomb() {
if [ $KEY ]; then if [ $KEY ]; then
tombkey=$KEY # commandline -k flag tombkey=$KEY # commandline -k flag
act "tomb key specified manually: $tombkey" act "tomb key specified manually: $tombkey"
elif [ -r ${tombdir}/${tombname}.key ]; then elif [ -r ${tombdir}/${tombname}.tomb.key ]; then
tombkey=${tombdir}/${tombname}.key tombkey=${tombdir}/${tombname}.tomb.key
act "key found for tomb '${tombname}': ${tombkey}" act "key found for tomb '${tombname}': ${tombkey}"
else else
error "key not found for tomb '${tombname}'" error "key not found for tomb '${tombname}'"
@ -340,7 +340,7 @@ create_tomb() {
exit 1 exit 1
fi fi
notice "Setup your secret key file ${tombname}.key" notice "Setup your secret key file ${tombname}.tomb.key"
# here user is prompted for key password # here user is prompted for key password
for c in 1 2 3; do for c in 1 2 3; do
@ -365,7 +365,7 @@ create_tomb() {
echo "${tombpass}" | gpg \ echo "${tombpass}" | gpg \
--openpgp --batch --no-options --no-tty --passphrase-fd 0 \ --openpgp --batch --no-options --no-tty --passphrase-fd 0 \
-o "${tombdir}/${tombname}.key" -c -a ${keytmp}/tomb.tmp -o "${tombdir}/${tombname}.tomb.key" -c -a ${keytmp}/tomb.tmp
if [ $? = 2 ]; then if [ $? = 2 ]; then
error "setting password failed: gnupg returns 2" error "setting password failed: gnupg returns 2"
@ -409,7 +409,7 @@ create_tomb() {
losetup -d ${nstloop} losetup -d ${nstloop}
act "done creating $tombname encrypted storage (using Luks dm-crypt AES/SHA256)" act "done creating $tombname encrypted storage (using Luks dm-crypt AES/SHA256)"
notice "Your tomb is ready in ${tombdir}/${tombfile} and secured with key ${tombname}.key" notice "Your tomb is ready in ${tombdir}/${tombfile} and secured with key ${tombname}.tomb.key"
} }
@ -580,7 +580,7 @@ decode_key() {
return 1 return 1
fi fi
keyfile=${tombname%%\.*}.key keyfile=${tombname%%\.*}.tomb.key
notice "Trying to exhume a key out of image $imagefile" notice "Trying to exhume a key out of image $imagefile"
for c in 1 2 3; do for c in 1 2 3; do
if [ $c = 1 ]; then if [ $c = 1 ]; then
@ -880,7 +880,7 @@ install_tomb() {
</mime-type> </mime-type>
<mime-type type="application/x-tomb-key"> <mime-type type="application/x-tomb-key">
<comment>Tomb crypto key</comment> <comment>Tomb crypto key</comment>
<glob pattern="*.key"/> <glob pattern="*.tomb.key"/>
</mime-type> </mime-type>
</mime-info> </mime-info>
EOF EOF
@ -901,7 +901,7 @@ Comment=Keep your bones safe
Exec=tomb-open %U Exec=tomb-open %U
TryExec=tomb-open TryExec=tomb-open
Icon=monmort.xpm Icon=monmort.xpm
Terminal=false Terminal=true
Categories=Utility;Security;Archiving;Filesystem; Categories=Utility;Security;Archiving;Filesystem;
MimeType=application/x-tomb-volume; MimeType=application/x-tomb-volume;
X-AppInstall-Package=tomb X-AppInstall-Package=tomb
@ -910,7 +910,7 @@ EOF
act "updating menus..." act "updating menus..."
cat <<EOF > /etc/menu/tomb cat <<EOF > /etc/menu/tomb
?package(tomb):command="tomb" icon="/usr/share/pixmaps/monmort.xpm" needs="cryptsetup" \ ?package(tomb):command="tomb" icon="/usr/share/pixmaps/monmort.xpm" needs="text" \
section="Applications/Accessories" title="Tomb" hints="Crypto" \ section="Applications/Accessories" title="Tomb" hints="Crypto" \
hotkey="Tomb" hotkey="Tomb"
EOF EOF
@ -931,7 +931,7 @@ application/x-tomb-volume
ext: tomb ext: tomb
application/x-tomb-key application/x-tomb-key
ext: key ext: tomb.key
EOF EOF
cat <<EOF > /usr/lib/mime/packages/tomb cat <<EOF > /usr/lib/mime/packages/tomb
application/x-tomb-volume; tomb-open '%s'; priority=8 application/x-tomb-volume; tomb-open '%s'; priority=8
@ -946,7 +946,7 @@ tomb
name=Tomb - Crypto Undertaker name=Tomb - Crypto Undertaker
can_open_multiple_files=false can_open_multiple_files=false
expects_uris=false expects_uris=false
requires_terminal=false requires_terminal=true
mime-types=application/x-tomb-volume,application/x-tomb-key mime-types=application/x-tomb-volume,application/x-tomb-key
EOF EOF
act "Tomb is now installed." act "Tomb is now installed."

View File

@ -168,8 +168,8 @@ if [ $1 ]; then # is it a file?
# is it a luks partition # is it a luks partition
file ${tombdir}/${tombfile} | grep -i LUKS > /dev/null file ${tombdir}/${tombfile} | grep -i LUKS > /dev/null
if [ $? = 0 ]; then # tomb is a valid LUKS file if [ $? = 0 ]; then # tomb is a valid LUKS file
if [ -r ${tombdir}/${tombname}.key ]; then if [ -r ${tombdir}/${tombname}.tomb.key ]; then
tombkey=${tombdir}/${tombname}.key tombkey=${tombdir}/${tombname}.tomb.key
else else
ask_usbkey ask_usbkey
if ! [ $usbkey_mount ]; then # no usb key was mounted if ! [ $usbkey_mount ]; then # no usb key was mounted
@ -177,8 +177,8 @@ if [ $1 ]; then # is it a file?
echo "operation aborted." # TODO: dialog with pinentry echo "operation aborted." # TODO: dialog with pinentry
exit 1 exit 1
else # usb mounted, check key presence else # usb mounted, check key presence
if [ -r ${usbkey_mount}/.tomb/${tombname}.key ]; then if [ -r ${usbkey_mount}/.tomb/${tombname}.tomb.key ]; then
tombkey=${usbkey_mount}/.tomb/${tombname}.key tombkey=${usbkey_mount}/.tomb/${tombname}.tomb.key
elif [ -r ${usbkey_mount}/.tomb ]; then elif [ -r ${usbkey_mount}/.tomb ]; then
echo "we can't find the right key, have a look yourself:" echo "we can't find the right key, have a look yourself:"
ls -lha ${usbkey_mount}/.tomb ls -lha ${usbkey_mount}/.tomb
@ -335,12 +335,12 @@ if [ $? = 0 ]; then
echo "${tombname}.key succesfully saved on your USB" echo "${tombname}.key succesfully saved on your USB"
echo "now we'll proceed opening your brand new tomb" echo "now we'll proceed opening your brand new tomb"
tomb -k ${tombname}.key open ${tombfile} tomb -k ${tombname}.tomb.key open ${tombfile}
if [ $? = 0 ]; then if [ $? = 0 ]; then
launch_status ${tombname} launch_status ${tombname}
fi fi
rm -f ${tombname}.key rm -f ${tombname}.tomb.key
sudo umount ${usbkey_mount} sudo umount ${usbkey_mount}
rmdir ${usbkey_mount} rmdir ${usbkey_mount}
@ -357,7 +357,7 @@ cat <<EOF
named .tomb inside the first partition of an usb key. named .tomb inside the first partition of an usb key.
EOF EOF
tomb -k ${tombname}.key open ${tombfile} tomb -k ${tombname}.tomb.key open ${tombfile}
if [ $? = 0 ]; then if [ $? = 0 ]; then
launch_status ${tombname} launch_status ${tombname}
fi fi