blob: 549bccd804db51c39f46f4b1218d1058b88d2090 (
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
|
# sm-sign+verify
#
# Requirements: a plain file "msg" and standard key setup
echo Creating a signature and verifying it
in = openfile msg
out = createfile msg.sig
in2 = openfile msg.sig
out2 = createfile msg.unsig
pipeserver /usr/local/bin/gpgsm
send INPUT FD=$in
expect-ok
send OUTPUT FD=$out
expect-ok
send SIGN
expect-ok
send RESET
expect-ok
send INPUT FD=$in2
expect-ok
send OUTPUT FD=$out2
expect-ok
send VERIFY
expect-ok
send BYE
expect-ok
# Unset variables so that the files get closed.
in =
out =
in2 =
out2=
cmpfiles msg msg.unsig
fail-if !$?
# Lets check it again with a new server instance.
in = openfile msg.sig
out = createfile msg.unsig
pipeserver /usr/local/bin/gpgsm
send INPUT FD=$in
expect-ok
send OUTPUT FD=$out
expect-ok
send VERIFY
expect-ok
cmpfiles msg msg.unsig
fail-if !$?
echo fine, it works
quit
|