File: test_decryption.sh

package info (click to toggle)
afflib 3.7.22-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,584 kB
  • sloc: cpp: 20,911; ansic: 15,912; makefile: 520; sh: 436; python: 192
file content (34 lines) | stat: -rwxr-xr-x 801 bytes parent folder | download | duplicates (8)
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
31
32
33
34
#!/bin/sh
# This file is a work of a US government employee and as such is in the Public domain.
# Simson L. Garfinkel, March 12, 2012


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.raw ) ; 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.raw ) ; 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