summaryrefslogtreecommitdiffstats
path: root/tests/openpgp/issue5120.scm
blob: 119d5f69a07e87e9fcdba00a8eeaf6e2d74924f8 (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
#!/usr/bin/env gpgscm

;; Regression tests for importing/signing Ed25519 keys which are
;; related to SOS representations, for issue 5120 and 5953.

;; Copyright (C) 2022 g10 Code GmbH
;;
;; This file is part of GnuPG.
;;
;; GnuPG is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3 of the License, or
;; (at your option) any later version.
;;
;; GnuPG is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, see <http://www.gnu.org/licenses/>.

(load (in-srcdir "tests" "openpgp" "defs.scm"))
(setup-legacy-environment)

;; A secret key made by SOS representation having leading-zeros
(define secret-key-non-protected-0 "-----BEGIN PGP PRIVATE KEY BLOCK-----

lFgEW9rRAxYJKwYBBAHaRw8BAQdAAAAfi+pCs8dMUKo1ibGqBl8ZaFfbl6deSlSV
Pwk+Z3IAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAltBpTYXZl
IE91ciBMZWFkaW5nIFplcm9zIDA5OYiaBBMWCgBCFiEE8sEmTikqKYrrS8NIYDMV
yTB5KUAFAlva0QMCGwMFCQPCZwAFCwkIBwIDIgIBBhUKCQgLAgQWAgMBAh4HAheA
AAoJEGAzFckweSlAQ84BAACkDMCCuSYRgXddPF3DZFNBV71nvSFiWJwEJ1FPOWwe
AP0RRuStMwJ/PhNcnYcRk7cSUQFUanHaCUvZs/flY9VjCw==
=muKZ
-----END PGP PRIVATE KEY BLOCK-----")

(pipe:do
 (pipe:echo secret-key-non-protected-0)
 (pipe:gpg '(--import)))

(pipe:do
 (pipe:echo "Please sign")
 (pipe:gpg '(--faked-system-time=1541067011
             --local-user "Save Our Leading Zeros 099" --armor --detach-sign)))

;; Another secret key having leading-bit 1
(define secret-key-non-protected-1 "-----BEGIN PGP PRIVATE KEY BLOCK-----

lFgEYml3ZxYJKwYBBAHaRw8BAQdAFIlUhDKHcbL1Kw0+aeh/F3erSIK/xVl402L3
YozMTXUAAQC9584RraZ+5Nh/xqaWQ9a9D4ifdfYYgSaFQpejpdNP7BJ8tAh0ZXN0
IGtleYiWBBMWCAA+FiEEh2Rw0j7f1zZZV/DTp9XsCtatsFEFAmJpd2cCGwMFCQPC
ZwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQp9XsCtatsFHwfAEAt9ea78Qe
qCxItQZO4Dw6VeUsQOnxcq4lOLrxl39yLWsBAKyvxAYMEOolXco8iUZ9z6TCmICc
XCri8UlEibk762oAnF0EYml3ZxIKKwYBBAGXVQEFAQEHQEZIAeEj1SG41845ieYY
cca9ySuZjOuxib9N0/1wju1aAwEIBwAA/1hFXTkXuRKFCQPTzjr/aB3O3AcxIPGz
moIpdVVRu+5gDxOIeAQYFggAIBYhBIdkcNI+39c2WVfw06fV7ArWrbBRBQJiaXdn
AhsMAAoJEKfV7ArWrbBRvz4A/3Q412OI2/V/uSIIQYrgHJvdqGPQ9xV8NHBu+Rzd
YanfAP9yDmJS7gkif1FVKmEaVINaXVu+U0GwkoIXAjo6mnPQAQ==
=l6au
-----END PGP PRIVATE KEY BLOCK-----")

(pipe:do
 (pipe:echo secret-key-non-protected-1)
 (pipe:gpg '(--import)))

(pipe:do
 (pipe:echo "test")
 (pipe:gpg '(--local-user "test key" --armor --detach-sign)))