~siretart/cryptsetup/debian

« back to all changes in this revision

Viewing changes to debian/scripts/decrypt_old_ssl

  • Committer: Reinhard Tartler
  • Date: 2008-08-06 13:15:36 UTC
  • Revision ID: siretart@tauware.de-20080806131536-52nd1v52wo7ft4zt
import cryptsetup_1.0.6-4.dsc

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
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
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 $?