Skip to content
Browse files

Work on a dependency check in progress

  • Loading branch information...
1 parent d98bab8 commit bc4548104eb05c9fa93f056843190b988321f4ae @thomasfrivold committed Nov 12, 2013
Showing with 23 additions and 17 deletions.
  1. +0 −3 LUKSUS
  2. +0 −11 LUKSUS.checks
  3. +23 −3 LUKSUS.functions
View
3 LUKSUS
@@ -89,12 +89,9 @@ trap EXITHOUSEKEEPING EXIT # calls housekeeping function on exit. Will be ru
trap TRAPERR ERR # displays where an error occurred
trap "rm -f $tempfile" 0 1 2 5 15
-
-
# Calling functions
OSTEST
-
# MENUSYSTEM - USER INTERACTION
GRAPHICALWELCOME
WELCOMEINFORMATION
View
11 LUKSUS.checks
@@ -15,17 +15,6 @@ then
echo ""
fi
-# Runtime Arguments Checking
-# I should use getops. Instead I make use of a crude but efficient
-# test to see if the user wants truecrypt.
-if [[ "$3" = "truecrypt" ]] || [[ "$4" = "truecrypt" ]] || [[ "$5" = "truecrypt" ]] || [[ "$6" = "truecrypt" ]] || [[ "$7" = "truecrypt" ]] || [[ "$8" = "truecrypt" ]] || [[ "$9" = "truecrypt" ]];
-then
-echo "Using Truecrypt"
-ENCRYPTION=TRUECRYPT
-if [ -z `which tcplay` ] ;then echo "Missing tcplay. Cannot continue. Please install Truecrypt (tcplay package)" && exit; fi
-else
-echo ""
-fi
# test to see if the user wants geli (FreeBSD)
if [[ "$3" = "geli" ]] || [[ "$4" = "geli" ]] || [[ "$5" = "geli" ]] || [[ "$6" = "geli" ]] || [[ "$7" = "geli" ]] || [[ "$8" = "geli" ]] || [[ "$9" = "geli" ]];
View
26 LUKSUS.functions
@@ -79,7 +79,6 @@ EXITHOUSEKEEPING()
rm *.$$
}
-
NAMESET()
{
name=$($dialogapp $DIALOGAPPOPTIONS --inputbox "Enter the volume name (nickname of the volume).\nExample: Mystuff\nNote no special characters or spaces" 0 0 3>&1 1>&2 2>&3)
@@ -188,6 +187,7 @@ do
esac
done
+# need to fill these variables again at this point
keyfile=/keys/$name.key
headerbackup=/keys/$name.header
mountpoint=/mnt/$name
@@ -510,9 +510,16 @@ LOOPBACKTEST ()
fi;
fi
}
+
LUKS ()
{
- if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
+# Runtime Verification Checking
+if [[ $ENCRYPTION == LUKS ]]; then
+$dialogapp --msgbox "Proceeding with $ENCRYPTION" 0 0;
+echo "Using LUKS"
+if [ -z `which cryptsetup` ] ; then echo "Cannot continue using LUKS. Missing cryptsetup. Please install cryptsetup (cryptsetup package)" && exit; fi else echo ""
+fi
+if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
echo LUKS with passphrase;
echo You will only be prompted for a password once. Type carefully.;
cryptsetup --batch-mode --verbose --cipher=aes-xts-plain64 luksFormat $device;
@@ -522,6 +529,11 @@ LUKS ()
}
LUKSKEYFILE ()
{
+# Runtime Verification Checking
+if [[ $ENCRYPTION == LUKS ]]; then
+$dialogapp --msgbox "Proceeding with $ENCRYPTION" 0 0;
+if [ -z `which cryptsetup` ] ; then echo "Missing cryptsetup. Cannot continue. Please install cryptsetup (cryptsetup package)" && exit; fi else echo ""
+fi
if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE = KEYFILE ]]; then
echo LUKS mode;
cryptsetup --batch-mode --verbose --key-size=512 --cipher=aes-xts-plain64 luksFormat $device $keyfile;
@@ -596,9 +608,14 @@ OSTEST ()
fi;
fi
}
+
TRUECRYPT ()
{
- if [[ $ENCRYPTION == TRUECRYPT ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
+$dialogapp --msgbox "Proceeding with $ENCRYPTION" 0 0;
+# if [[ $ENCRYPTION == TRUECRYPT ]]; then
+if [ -z `which tcplay` ] ; then echo "Missing tcplay. Cannot continue. Please install Truecrypt (tcplay package). Note that you need the Libre Open Source GPL tcplay Truecrypt package and not the Truecrypt package downloaded from the Truecrypt.com website"
+&& exit; fi
+if [[ $ENCRYPTION == TRUECRYPT ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
echo TrueCrypt mode;
tcplay --create --device=$device --cipher=AES-256-XTS;
else
@@ -607,6 +624,9 @@ TRUECRYPT ()
}
TRUECRYPTKEYFILE ()
{
+$dialogapp --msgbox "Proceeding with $ENCRYPTION" 0 0;
+if [[ $ENCRYPTION == TRUECRYPT ]]; then
+if [ -z `which tcplay` ] ; then echo "Missing tcplay. Cannot continue. Please install Truecrypt (tcplay package)" && exit; fi
if [[ $ENCRYPTION == TRUECRYPT ]] && [[ $SECURITYMODE == KEYFILE ]]; then
echo TrueCrypt mode and adding a keyfile. Truecrypt asks for a password in any case. The container will also have a keyfile;
tcplay --create --device=$device --cipher=AES-256-XTS --keyfile=$keyfile;

0 comments on commit bc45481

Please sign in to comment.
Something went wrong with that request. Please try again.