File: test_decryption.sh

package info (click to toggle)
afflib 3.6.6-1.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,320 kB
  • sloc: cpp: 21,493; ansic: 14,745; sh: 11,235; makefile: 538; python: 95
file content (30 lines) | stat: -rwxr-xr-x 674 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
echo === VERIFY THAT WE CAN STILL DECRYPT encrypted.aff ===
unset AFFLIB_PASSPHRASE

if test "x$srcdir" = x; then
  srcdir=.
fi

if ( ../tools/affcompare file://:password@/$srcdir/encrypted.aff $srcdir/encrypted.iso ) ; then
  echo Verifies with correct decryption passphrase.
else
  echo Does not verify with correct decryption passphrase.
  exit 1
fi


echo This next affcompare should generate an error:
if ( ../tools/affcompare file://:wrongphrase@/$srcdir/encrypted.aff $srcdir/encrypted.iso ) ; then
  echo Does not verify with correct decryption passphrase.
  exit 1
else
  echo Cannot verify with the wrong passphrase!  
fi

echo ALL TESTS PASS
exit 0