3 ;; Copyright (C) 2016 g10 Code GmbH
5 ;; This file is part of GnuPG.
7 ;; GnuPG is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 3 of the License, or
10 ;; (at your option) any later version.
12 ;; GnuPG is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with this program; if not, see <http://www.gnu.org/licenses/>.
20 (load (with-path "defs.scm"))
21 (setup-legacy-environment)
23 (define msg_signed_asc "
24 -----BEGIN PGP SIGNED MESSAGE-----
27 This is an example text file to demonstrate a problem.
29 Using forged-keyring.gpg with signature cache, it looks like it is
30 signed by the following key:
32 Echo Test (demo key) <echo@example.net>
36 It is signed by a key (steve.biko@example.net) distributed as:
38 gnupg/tests/openpgp/samplekeys/rsa-rsa-sample-1.asc
42 The forged-keyring.gpg file is created by a key in
44 gnupg/tests/openpgp/pubdemo.asc
46 Replacing the raw key material packet by one of rsa-rsa-sample-1.asc.
47 -----BEGIN PGP SIGNATURE-----
50 iQEcBAEBCAAGBQJXp+5MAAoJEKpD8dzH/tG3bGMH/1idFLJAaMxkrq+JguvAboiN
51 tAA44IdAgJvAxtR5w5fgfed7PfsH70+tj54/ZTObt7rZDIlj/YBQ7XeCwd7/O5vx
52 W0QtjjAxMuAPH80rVv4JIoflxV/deD8YaV9EhPE+6W5G0Z8SYL9B2RzdBVMwJY9+
53 OZGJeKnUZ92Zg9jFr+H5gQNSeYdDHVDWYxr/xJUf0jYsZvAIBfB1mcSK1niiiVBv
54 GAcUC/I8g18a7pCS9Qf9iZflqxX4AXfocAGQqQAiG4744OCNhVa5q6TScqhaGUah
55 N1Glbw1OJfP1q+QFPMPKoCsTYmZpuugq2b5gV/eH0Abvk2pG4Fo/YTDPHhec7Jk=
57 -----END PGP SIGNATURE-----
61 "Checking that a signature by bad key should not be verified"
62 (lambda (armored-file)
65 (pipe:echo (eval armored-file (current-environment)))
66 (pipe:spawn `(,@GPGV --keyring ,(in-srcdir "forged-keyring.gpg"))))
67 (fail "verification succeeded but should not")))