5 # Make sure $srcdir is set.
8 echo srcdir environment variable not set!
12 . $srcdir/defs.inc || exit 3
16 # Make sure $GNUPGHOME is set.
17 if test "x$GNUPGHOME" = x
19 echo "GNUPGHOME not set."
23 TESTFILES="$plain_files $data_files"
26 FILELIST="${TESTDIR}/filelist"
27 PPFILE="${TESTDIR}/passphrase"
28 PPFLAGS="--gpg-args --passphrase-file=$PPFILE"
31 GPGARGS="$opt_always --no-permission-warning"
33 GPGTAR="../../tools/gpgtar"
34 GPGZIP="sh ../../tools/gpg-zip"
36 # Skip test if gpgtar has not been built.
37 if ! test -x "$GPGTAR"
42 # Create, inspect, and extract an archive with the given options.
45 # $2 options used to create the archive
46 # $3 options used to inspect the archive
47 # $4 options used to extract the archive
56 rm -rf -- "${TESTDIR}"
60 $TOOL --gpg "$GPG" --gpg-args "$GPGARGS" $CREATE_FLAGS \
61 --output "${TESTDIR}/test.tar.pgp" $TESTFILES
63 $TOOL --gpg "$GPG" --gpg-args "$GPGARGS" $INSPECT_FLAGS \
64 "${TESTDIR}/test.tar.pgp" \
68 awk '{print $NF}' "$FILELIST" | grep "^${F}$" >/dev/null
71 $TOOL --gpg "$GPG" --gpg-args "$GPGARGS" $EXTRACT_FLAGS --quiet \
72 --tar-args --directory="${TESTDIR}" \
73 "${TESTDIR}/test.tar.pgp"
76 cmp "$F" "${TESTDIR}/$F"
81 for TOOL in "$GPGTAR" "$GPGZIP"
82 #for TOOL in "$GPGZIP"
84 # Asymmetric encryption.
86 "--encrypt --recipient $usrname2" \
90 # Asymmetric encryption and signing.
92 "--encrypt --recipient $usrname2 --sign --local-user $usrname3" \
98 "--sign --local-user $usrname3" \
102 # Symmetric encryption.
104 "${PPFLAGS} --symmetric" \
105 "${PPFLAGS} --list-archive" \
106 "${PPFLAGS} --decrypt"
108 # Symmetric encryption, explicitly choose cipher.
109 for a in `all_cipher_algos`; do
111 "${PPFLAGS} --gpg-args --cipher=$a --symmetric" \
112 "${PPFLAGS} --list-archive" \
113 "${PPFLAGS} --decrypt"
117 # Asymmetric and symmetric encryption, and signing.
119 "${PPFLAGS} --encrypt --symmetric --recipient $usrname2 --sign --local-user $usrname3" \
120 "${PPFLAGS} --list-archive" \
121 "${PPFLAGS} --decrypt"