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"))
23 (info "Checking bug 894: segv importing certain keys.")
24 (call-check `(,(tool 'gpg) --import ,(in-srcdir "bug894-test.asc")))
26 (define keyid "0xC108E83A")
27 (info "Checking bug 1223: designated revoker sigs are not properly merged.")
28 (call `(,(tool 'gpg) --delete-key --batch --yes ,keyid))
29 (call `(,(tool 'gpg) --import ,(in-srcdir "bug1223-bogus.asc")))
30 (call `(,(tool 'gpg) --import ,(in-srcdir "bug1223-good.asc")))
33 (pipe:gpg `(--list-keys --with-colons ,keyid)))
36 ;; XXX we do not have a regexp library
37 (unless (any (lambda (line)
38 (and (string-prefix? line "rvk:")
39 (string-contains? line ":0EE5BE979282D80B9F7540F1CCD2ED94D21739E9:")))
40 (string-split-newlines c))
43 (define fpr1 "9E669861368BCA0BE42DAF7DDDA252EBB8EBE1AF")
44 (define fpr2 "A55120427374F3F7AA5F1166DDA252EBB8EBE1AF")
45 (info "Checking import of two keys with colliding long key ids.")
46 (call `(,(tool 'gpg) --delete-key --batch --yes ,fpr1 ,fpr2))
47 (call `(,(tool 'gpg) --import ,(in-srcdir "samplekeys/dda252ebb8ebe1af-1.asc")))
48 (call `(,(tool 'gpg) --import ,(in-srcdir "samplekeys/dda252ebb8ebe1af-2.asc")))
51 (pipe:gpg `(--list-keys --with-colons ,fpr1 ,fpr2)))
54 ;; XXX we do not have a regexp library
57 (and (string-prefix? line "pub:")
58 (string-contains? line ":4096:1:DDA252EBB8EBE1AF:")))
59 (string-split-newlines c))))
60 (unless (= 2 (length keys))
61 (fail "Importing keys with long id collision failed"))))))