~siretart/cryptsetup/debian

2 by Reinhard Tartler
import cryptsetup_1.0.4+svn29-1.dsc
1
#!/bin/sh
2
3
decrypt_ssl () {
4
	local key tmpkey rc tries maxtries
5
	key="$1"
6
	tmpkey=$(tempfile)
7
8
	echo "Performing (deprecated) two-pass-ssl decryption" >&2
13 by Reinhard Tartler
import cryptsetup_1.0.6-3.dsc
9
	if ! /usr/bin/openssl enc -aes256 -d -salt -in $key -out $tmpkey > /dev/null 2>&1; then
10
		echo "First pass decryption failed" >&2
11
		return 1
12
	fi
13
14
	if ! /usr/bin/openssl dsa -in $tmpkey 2> /dev/null; then
15
		echo "Second pass decryption failed" >&2
16
		rm -f "$tmpkey"
17
		return 1
18
	fi
2 by Reinhard Tartler
import cryptsetup_1.0.4+svn29-1.dsc
19
20
	rm -f "$tmpkey"
21
	return 0
22
}
23
24
if [ -z "$1" ]; then
25
	exit 1
26
fi
27
decrypt_ssl "$1"
28
exit $?