summaryrefslogtreecommitdiffstats
path: root/checks/clearsig.test
blob: 99dca45f86ec10285fba039e11c11e37583d0f3e (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/sh


# Fixme: we should not only do a --verify but also the output.



. $srcdir/defs.inc || exit 3


# ======================================
# I can't compare the out because plain-3 has no LF as last charcater
# but the output has always one.  I do not thinkl this is a bug, because
# it is clear text and not binary text.
# ======================================
for i in $plain_files plain-large ; do
    echo "$usrpass1" | $srcdir/run-gpg --passphrase-fd 0 -sat -o x --yes $i
    $srcdir/run-gpg --verify x
done

# ======================================
# and once more to check rfc1991
# ======================================
for i in $plain_files plain-large ; do
    echo "$usrpass1" | $srcdir/run-gpg --passphrase-fd 0 \
			 --rfc1991 --digest-algo md5 -sat -o x --yes $i
    $srcdir/run-gpg --verify x
done

# ======================================
# and one with long lines
# ======================================
cat >y <<EOF
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyx

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
EOF
echo "$usrpass1" | $srcdir/run-gpg --passphrase-fd 0 --clearsign -o x --yes y
$srcdir/run-gpg --verify x

# ======================================
# and one with only one long lines
# ======================================
cat >y <<EOF
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyx
EOF
echo "$usrpass1" | $srcdir/run-gpg --passphrase-fd 0 --clearsign -o x --yes y
$srcdir/run-gpg --verify x
# and one with an empty body
# ======================================
cat >y <<EOF
EOF
echo "$usrpass1" | $srcdir/run-gpg --passphrase-fd 0 --clearsign -o x --yes y
$srcdir/run-gpg --verify x

# ======================================
# and one with one empty line at the end
# ======================================
cat >y <<EOF
line 1
line 2
line 3
there is a blank line after this

EOF
echo "$usrpass1" | $srcdir/run-gpg --passphrase-fd 0 --clearsign -o x --yes y
$srcdir/run-gpg --verify x


# ======================================
# I think this file will be contructed wrong (gpg 0.9.3)
# but it should verify okay anyway.
# bash's builtin echo needs the option -e so we use the external one.
# ======================================
echo "this is a sig test" >y
/bin/echo " \c" >>y
echo "$usrpass1" | $srcdir/run-gpg --passphrase-fd 0 --clearsign -o x --yes y
$srcdir/run-gpg --verify x