diff options
| -rw-r--r-- | Makefile.am | 20 | ||||
| -rw-r--r-- | build-aux/test-env.in | 6 | ||||
| -rw-r--r-- | guix/tests/gnupg.scm | 22 | ||||
| -rw-r--r-- | tests/channels.scm | 18 | ||||
| -rw-r--r-- | tests/git-authenticate.scm | 23 | ||||
| -rw-r--r-- | tests/guix-authenticate.sh | 4 | ||||
| -rw-r--r-- | tests/keys/civodul.pub (renamed from tests/civodul.key) | 0 | ||||
| -rw-r--r-- | tests/keys/dsa.pub (renamed from tests/dsa.key) | 0 | ||||
| -rw-r--r-- | tests/keys/ed25519-2.pub (renamed from tests/ed25519bis.key) | 0 | ||||
| -rw-r--r-- | tests/keys/ed25519-2.sec (renamed from tests/ed25519bis.sec) | 0 | ||||
| -rw-r--r-- | tests/keys/ed25519-3.pub | 9 | ||||
| -rw-r--r-- | tests/keys/ed25519-3.sec | 10 | ||||
| -rw-r--r-- | tests/keys/ed25519.pub (renamed from tests/ed25519.key) | 0 | ||||
| -rw-r--r-- | tests/keys/ed25519.sec (renamed from tests/ed25519.sec) | 0 | ||||
| -rw-r--r-- | tests/keys/rsa.pub (renamed from tests/rsa.key) | 0 | ||||
| -rw-r--r-- | tests/keys/signing-key.pub (renamed from tests/signing-key.pub) | 0 | ||||
| -rw-r--r-- | tests/keys/signing-key.sec (renamed from tests/signing-key.sec) | 0 | ||||
| -rw-r--r-- | tests/openpgp.scm | 42 |
18 files changed, 93 insertions, 61 deletions
diff --git a/Makefile.am b/Makefile.am index c4ccee65f19..d39052521b2 100644 --- a/Makefile.am +++ b/Makefile.am | |||
| @@ -653,16 +653,18 @@ EXTRA_DIST += \ | |||
| 653 | build-aux/update-guix-package.scm \ | 653 | build-aux/update-guix-package.scm \ |
| 654 | build-aux/update-NEWS.scm \ | 654 | build-aux/update-NEWS.scm \ |
| 655 | tests/test.drv \ | 655 | tests/test.drv \ |
| 656 | tests/signing-key.pub \ | ||
| 657 | tests/signing-key.sec \ | ||
| 658 | tests/cve-sample.json \ | 656 | tests/cve-sample.json \ |
| 659 | tests/civodul.key \ | 657 | tests/keys/signing-key.pub \ |
| 660 | tests/rsa.key \ | 658 | tests/keys/signing-key.sec \ |
| 661 | tests/dsa.key \ | 659 | tests/keys/civodul.pub \ |
| 662 | tests/ed25519.key \ | 660 | tests/keys/rsa.pub \ |
| 663 | tests/ed25519.sec \ | 661 | tests/keys/dsa.pub \ |
| 664 | tests/ed25519bis.key \ | 662 | tests/keys/ed25519.pub \ |
| 665 | tests/ed25519bis.sec \ | 663 | tests/keys/ed25519.sec \ |
| 664 | tests/keys/ed25519-2.pub \ | ||
| 665 | tests/keys/ed25519-2.sec \ | ||
| 666 | tests/keys/ed25519-3.pub \ | ||
| 667 | tests/keys/ed25519-3.sec \ | ||
| 666 | build-aux/config.rpath \ | 668 | build-aux/config.rpath \ |
| 667 | bootstrap \ | 669 | bootstrap \ |
| 668 | doc/build.scm \ | 670 | doc/build.scm \ |
diff --git a/build-aux/test-env.in b/build-aux/test-env.in index 7efc43206c2..ca786437e99 100644 --- a/build-aux/test-env.in +++ b/build-aux/test-env.in | |||
| @@ -73,9 +73,9 @@ then | |||
| 73 | # Copy the keys so that the secret key has the right permissions (the | 73 | # Copy the keys so that the secret key has the right permissions (the |
| 74 | # daemon errors out when this is not the case.) | 74 | # daemon errors out when this is not the case.) |
| 75 | mkdir -p "$GUIX_CONFIGURATION_DIRECTORY" | 75 | mkdir -p "$GUIX_CONFIGURATION_DIRECTORY" |
| 76 | cp "@abs_top_srcdir@/tests/signing-key.sec" \ | 76 | cp "@abs_top_srcdir@/tests/keys/signing-key.sec" \ |
| 77 | "@abs_top_srcdir@/tests/signing-key.pub" \ | 77 | "@abs_top_srcdir@/tests/keys/signing-key.pub" \ |
| 78 | "$GUIX_CONFIGURATION_DIRECTORY" | 78 | "$GUIX_CONFIGURATION_DIRECTORY" |
| 79 | chmod 400 "$GUIX_CONFIGURATION_DIRECTORY/signing-key.sec" | 79 | chmod 400 "$GUIX_CONFIGURATION_DIRECTORY/signing-key.sec" |
| 80 | fi | 80 | fi |
| 81 | 81 | ||
diff --git a/guix/tests/gnupg.scm b/guix/tests/gnupg.scm index eb8ff63a43a..943fd66077b 100644 --- a/guix/tests/gnupg.scm +++ b/guix/tests/gnupg.scm | |||
| @@ -28,8 +28,10 @@ | |||
| 28 | 28 | ||
| 29 | %ed25519-public-key-file | 29 | %ed25519-public-key-file |
| 30 | %ed25519-secret-key-file | 30 | %ed25519-secret-key-file |
| 31 | %ed25519bis-public-key-file | 31 | %ed25519-2-public-key-file |
| 32 | %ed25519bis-secret-key-file | 32 | %ed25519-2-secret-key-file |
| 33 | %ed25519-3-public-key-file | ||
| 34 | %ed25519-3-secret-key-file | ||
| 33 | 35 | ||
| 34 | read-openpgp-packet | 36 | read-openpgp-packet |
| 35 | key-fingerprint | 37 | key-fingerprint |
| @@ -63,13 +65,17 @@ process is terminated afterwards." | |||
| 63 | (call-with-fresh-gnupg-setup imported (lambda () exp ...))) | 65 | (call-with-fresh-gnupg-setup imported (lambda () exp ...))) |
| 64 | 66 | ||
| 65 | (define %ed25519-public-key-file | 67 | (define %ed25519-public-key-file |
| 66 | (search-path %load-path "tests/ed25519.key")) | 68 | (search-path %load-path "tests/keys/ed25519.pub")) |
| 67 | (define %ed25519-secret-key-file | 69 | (define %ed25519-secret-key-file |
| 68 | (search-path %load-path "tests/ed25519.sec")) | 70 | (search-path %load-path "tests/keys/ed25519.sec")) |
| 69 | (define %ed25519bis-public-key-file | 71 | (define %ed25519-2-public-key-file |
| 70 | (search-path %load-path "tests/ed25519bis.key")) | 72 | (search-path %load-path "tests/keys/ed25519-2.pub")) |
| 71 | (define %ed25519bis-secret-key-file | 73 | (define %ed25519-2-secret-key-file |
| 72 | (search-path %load-path "tests/ed25519bis.sec")) | 74 | (search-path %load-path "tests/keys/ed25519-2.sec")) |
| 75 | (define %ed25519-3-public-key-file | ||
| 76 | (search-path %load-path "tests/keys/ed25519-3.pub")) | ||
| 77 | (define %ed25519-3-secret-key-file | ||
| 78 | (search-path %load-path "tests/keys/ed25519-3.sec")) | ||
| 73 | 79 | ||
| 74 | (define (read-openpgp-packet file) | 80 | (define (read-openpgp-packet file) |
| 75 | (get-openpgp-packet | 81 | (get-openpgp-packet |
diff --git a/tests/channels.scm b/tests/channels.scm index 3e82315b0c7..d45c450241d 100644 --- a/tests/channels.scm +++ b/tests/channels.scm | |||
| @@ -480,8 +480,8 @@ | |||
| 480 | #t | 480 | #t |
| 481 | (with-fresh-gnupg-setup (list %ed25519-public-key-file | 481 | (with-fresh-gnupg-setup (list %ed25519-public-key-file |
| 482 | %ed25519-secret-key-file | 482 | %ed25519-secret-key-file |
| 483 | %ed25519bis-public-key-file | 483 | %ed25519-2-public-key-file |
| 484 | %ed25519bis-secret-key-file) | 484 | %ed25519-2-secret-key-file) |
| 485 | (with-temporary-git-repository directory | 485 | (with-temporary-git-repository directory |
| 486 | `((add ".guix-channel" | 486 | `((add ".guix-channel" |
| 487 | ,(object->string | 487 | ,(object->string |
| @@ -507,7 +507,7 @@ | |||
| 507 | (commit-id-string commit1) | 507 | (commit-id-string commit1) |
| 508 | (openpgp-public-key-fingerprint | 508 | (openpgp-public-key-fingerprint |
| 509 | (read-openpgp-packet | 509 | (read-openpgp-packet |
| 510 | %ed25519bis-public-key-file)))) ;different key | 510 | %ed25519-2-public-key-file)))) ;different key |
| 511 | (channel (channel (name 'example) | 511 | (channel (channel (name 'example) |
| 512 | (url (string-append "file://" directory)) | 512 | (url (string-append "file://" directory)) |
| 513 | (introduction intro)))) | 513 | (introduction intro)))) |
| @@ -519,7 +519,7 @@ | |||
| 519 | (oid->string (commit-id commit1)) | 519 | (oid->string (commit-id commit1)) |
| 520 | (key-fingerprint %ed25519-public-key-file) | 520 | (key-fingerprint %ed25519-public-key-file) |
| 521 | (key-fingerprint | 521 | (key-fingerprint |
| 522 | %ed25519bis-public-key-file)))))) | 522 | %ed25519-2-public-key-file)))))) |
| 523 | (authenticate-channel channel directory | 523 | (authenticate-channel channel directory |
| 524 | (commit-id-string commit2) | 524 | (commit-id-string commit2) |
| 525 | #:keyring-reference-prefix "") | 525 | #:keyring-reference-prefix "") |
| @@ -530,8 +530,8 @@ | |||
| 530 | #t | 530 | #t |
| 531 | (with-fresh-gnupg-setup (list %ed25519-public-key-file | 531 | (with-fresh-gnupg-setup (list %ed25519-public-key-file |
| 532 | %ed25519-secret-key-file | 532 | %ed25519-secret-key-file |
| 533 | %ed25519bis-public-key-file | 533 | %ed25519-2-public-key-file |
| 534 | %ed25519bis-secret-key-file) | 534 | %ed25519-2-secret-key-file) |
| 535 | (with-temporary-git-repository directory | 535 | (with-temporary-git-repository directory |
| 536 | `((add ".guix-channel" | 536 | `((add ".guix-channel" |
| 537 | ,(object->string | 537 | ,(object->string |
| @@ -552,12 +552,12 @@ | |||
| 552 | (signer ,(key-fingerprint %ed25519-public-key-file))) | 552 | (signer ,(key-fingerprint %ed25519-public-key-file))) |
| 553 | (add "c.txt" "C") | 553 | (add "c.txt" "C") |
| 554 | (commit "third commit" | 554 | (commit "third commit" |
| 555 | (signer ,(key-fingerprint %ed25519bis-public-key-file))) | 555 | (signer ,(key-fingerprint %ed25519-2-public-key-file))) |
| 556 | (branch "channel-keyring") | 556 | (branch "channel-keyring") |
| 557 | (checkout "channel-keyring") | 557 | (checkout "channel-keyring") |
| 558 | (add "signer.key" ,(call-with-input-file %ed25519-public-key-file | 558 | (add "signer.key" ,(call-with-input-file %ed25519-public-key-file |
| 559 | get-string-all)) | 559 | get-string-all)) |
| 560 | (add "other.key" ,(call-with-input-file %ed25519bis-public-key-file | 560 | (add "other.key" ,(call-with-input-file %ed25519-2-public-key-file |
| 561 | get-string-all)) | 561 | get-string-all)) |
| 562 | (commit "keyring commit") | 562 | (commit "keyring commit") |
| 563 | (checkout "master")) | 563 | (checkout "master")) |
| @@ -588,7 +588,7 @@ | |||
| 588 | (unauthorized-commit-error-signing-key c)) | 588 | (unauthorized-commit-error-signing-key c)) |
| 589 | (openpgp-public-key-fingerprint | 589 | (openpgp-public-key-fingerprint |
| 590 | (read-openpgp-packet | 590 | (read-openpgp-packet |
| 591 | %ed25519bis-public-key-file)))))) | 591 | %ed25519-2-public-key-file)))))) |
| 592 | (authenticate-channel channel directory | 592 | (authenticate-channel channel directory |
| 593 | (commit-id-string commit3) | 593 | (commit-id-string commit3) |
| 594 | #:keyring-reference-prefix "") | 594 | #:keyring-reference-prefix "") |
diff --git a/tests/git-authenticate.scm b/tests/git-authenticate.scm index d87eacc6596..f66ef191b09 100644 --- a/tests/git-authenticate.scm +++ b/tests/git-authenticate.scm | |||
| @@ -161,14 +161,14 @@ | |||
| 161 | (test-assert "signed commits, .guix-authorizations, unauthorized merge" | 161 | (test-assert "signed commits, .guix-authorizations, unauthorized merge" |
| 162 | (with-fresh-gnupg-setup (list %ed25519-public-key-file | 162 | (with-fresh-gnupg-setup (list %ed25519-public-key-file |
| 163 | %ed25519-secret-key-file | 163 | %ed25519-secret-key-file |
| 164 | %ed25519bis-public-key-file | 164 | %ed25519-2-public-key-file |
| 165 | %ed25519bis-secret-key-file) | 165 | %ed25519-2-secret-key-file) |
| 166 | (with-temporary-git-repository directory | 166 | (with-temporary-git-repository directory |
| 167 | `((add "signer1.key" | 167 | `((add "signer1.key" |
| 168 | ,(call-with-input-file %ed25519-public-key-file | 168 | ,(call-with-input-file %ed25519-public-key-file |
| 169 | get-string-all)) | 169 | get-string-all)) |
| 170 | (add "signer2.key" | 170 | (add "signer2.key" |
| 171 | ,(call-with-input-file %ed25519bis-public-key-file | 171 | ,(call-with-input-file %ed25519-2-public-key-file |
| 172 | get-string-all)) | 172 | get-string-all)) |
| 173 | (add ".guix-authorizations" | 173 | (add ".guix-authorizations" |
| 174 | ,(object->string | 174 | ,(object->string |
| @@ -184,7 +184,7 @@ | |||
| 184 | (checkout "devel") | 184 | (checkout "devel") |
| 185 | (add "devel/1.txt" "1") | 185 | (add "devel/1.txt" "1") |
| 186 | (commit "first devel commit" | 186 | (commit "first devel commit" |
| 187 | (signer ,(key-fingerprint %ed25519bis-public-key-file))) | 187 | (signer ,(key-fingerprint %ed25519-2-public-key-file))) |
| 188 | (checkout "master") | 188 | (checkout "master") |
| 189 | (add "b.txt" "B") | 189 | (add "b.txt" "B") |
| 190 | (commit "second commit" | 190 | (commit "second commit" |
| @@ -203,7 +203,7 @@ | |||
| 203 | (openpgp-public-key-fingerprint | 203 | (openpgp-public-key-fingerprint |
| 204 | (unauthorized-commit-error-signing-key c)) | 204 | (unauthorized-commit-error-signing-key c)) |
| 205 | (openpgp-public-key-fingerprint | 205 | (openpgp-public-key-fingerprint |
| 206 | (read-openpgp-packet %ed25519bis-public-key-file))))) | 206 | (read-openpgp-packet %ed25519-2-public-key-file))))) |
| 207 | 207 | ||
| 208 | (and (authenticate-commits repository (list master1 master2) | 208 | (and (authenticate-commits repository (list master1 master2) |
| 209 | #:keyring-reference "master") | 209 | #:keyring-reference "master") |
| @@ -230,14 +230,14 @@ | |||
| 230 | (test-assert "signed commits, .guix-authorizations, authorized merge" | 230 | (test-assert "signed commits, .guix-authorizations, authorized merge" |
| 231 | (with-fresh-gnupg-setup (list %ed25519-public-key-file | 231 | (with-fresh-gnupg-setup (list %ed25519-public-key-file |
| 232 | %ed25519-secret-key-file | 232 | %ed25519-secret-key-file |
| 233 | %ed25519bis-public-key-file | 233 | %ed25519-2-public-key-file |
| 234 | %ed25519bis-secret-key-file) | 234 | %ed25519-2-secret-key-file) |
| 235 | (with-temporary-git-repository directory | 235 | (with-temporary-git-repository directory |
| 236 | `((add "signer1.key" | 236 | `((add "signer1.key" |
| 237 | ,(call-with-input-file %ed25519-public-key-file | 237 | ,(call-with-input-file %ed25519-public-key-file |
| 238 | get-string-all)) | 238 | get-string-all)) |
| 239 | (add "signer2.key" | 239 | (add "signer2.key" |
| 240 | ,(call-with-input-file %ed25519bis-public-key-file | 240 | ,(call-with-input-file %ed25519-2-public-key-file |
| 241 | get-string-all)) | 241 | get-string-all)) |
| 242 | (add ".guix-authorizations" | 242 | (add ".guix-authorizations" |
| 243 | ,(object->string | 243 | ,(object->string |
| @@ -258,12 +258,12 @@ | |||
| 258 | %ed25519-public-key-file) | 258 | %ed25519-public-key-file) |
| 259 | (name "Alice")) | 259 | (name "Alice")) |
| 260 | (,(key-fingerprint | 260 | (,(key-fingerprint |
| 261 | %ed25519bis-public-key-file)))))) | 261 | %ed25519-2-public-key-file)))))) |
| 262 | (commit "first devel commit" | 262 | (commit "first devel commit" |
| 263 | (signer ,(key-fingerprint %ed25519-public-key-file))) | 263 | (signer ,(key-fingerprint %ed25519-public-key-file))) |
| 264 | (add "devel/2.txt" "2") | 264 | (add "devel/2.txt" "2") |
| 265 | (commit "second devel commit" | 265 | (commit "second devel commit" |
| 266 | (signer ,(key-fingerprint %ed25519bis-public-key-file))) | 266 | (signer ,(key-fingerprint %ed25519-2-public-key-file))) |
| 267 | (checkout "master") | 267 | (checkout "master") |
| 268 | (add "b.txt" "B") | 268 | (add "b.txt" "B") |
| 269 | (commit "second commit" | 269 | (commit "second commit" |
| @@ -273,7 +273,7 @@ | |||
| 273 | ;; After the merge, the second signer is authorized. | 273 | ;; After the merge, the second signer is authorized. |
| 274 | (add "c.txt" "C") | 274 | (add "c.txt" "C") |
| 275 | (commit "third commit" | 275 | (commit "third commit" |
| 276 | (signer ,(key-fingerprint %ed25519bis-public-key-file)))) | 276 | (signer ,(key-fingerprint %ed25519-2-public-key-file)))) |
| 277 | (with-repository directory repository | 277 | (with-repository directory repository |
| 278 | (let ((master1 (find-commit repository "first commit")) | 278 | (let ((master1 (find-commit repository "first commit")) |
| 279 | (master2 (find-commit repository "second commit")) | 279 | (master2 (find-commit repository "second commit")) |
| @@ -328,4 +328,3 @@ | |||
| 328 | 'failed))))))) | 328 | 'failed))))))) |
| 329 | 329 | ||
| 330 | (test-end "git-authenticate") | 330 | (test-end "git-authenticate") |
| 331 | |||
diff --git a/tests/guix-authenticate.sh b/tests/guix-authenticate.sh index 3a05b232c1f..0de6da18784 100644 --- a/tests/guix-authenticate.sh +++ b/tests/guix-authenticate.sh | |||
| @@ -28,7 +28,7 @@ rm -f "$sig" "$hash" | |||
| 28 | 28 | ||
| 29 | trap 'rm -f "$sig" "$hash"' EXIT | 29 | trap 'rm -f "$sig" "$hash"' EXIT |
| 30 | 30 | ||
| 31 | key="$abs_top_srcdir/tests/signing-key.sec" | 31 | key="$abs_top_srcdir/tests/keys/signing-key.sec" |
| 32 | key_len="`echo -n $key | wc -c`" | 32 | key_len="`echo -n $key | wc -c`" |
| 33 | 33 | ||
| 34 | # A hexadecimal string as long as a sha256 hash. | 34 | # A hexadecimal string as long as a sha256 hash. |
| @@ -67,7 +67,7 @@ test "$code" -ne 0 | |||
| 67 | # encoded independently of the current locale: <https://bugs.gnu.org/43421>. | 67 | # encoded independently of the current locale: <https://bugs.gnu.org/43421>. |
| 68 | hash="636166e9636166e9636166e9636166e9636166e9636166e9636166e9636166e9" | 68 | hash="636166e9636166e9636166e9636166e9636166e9636166e9636166e9636166e9" |
| 69 | latin1_cafe="caf$(printf '\351')" | 69 | latin1_cafe="caf$(printf '\351')" |
| 70 | echo "sign 21:tests/signing-key.sec 64:$hash" | guix authenticate \ | 70 | echo "sign 26:tests/keys/signing-key.sec 64:$hash" | guix authenticate \ |
| 71 | | LC_ALL=C grep "hash sha256 \"$latin1_cafe" | 71 | | LC_ALL=C grep "hash sha256 \"$latin1_cafe" |
| 72 | 72 | ||
| 73 | # Test for <http://bugs.gnu.org/17312>: make sure 'guix authenticate' produces | 73 | # Test for <http://bugs.gnu.org/17312>: make sure 'guix authenticate' produces |
diff --git a/tests/civodul.key b/tests/keys/civodul.pub index 272600ac937..272600ac937 100644 --- a/tests/civodul.key +++ b/tests/keys/civodul.pub | |||
diff --git a/tests/dsa.key b/tests/keys/dsa.pub index 4727975c634..4727975c634 100644 --- a/tests/dsa.key +++ b/tests/keys/dsa.pub | |||
diff --git a/tests/ed25519bis.key b/tests/keys/ed25519-2.pub index f5329105d59..f5329105d59 100644 --- a/tests/ed25519bis.key +++ b/tests/keys/ed25519-2.pub | |||
diff --git a/tests/ed25519bis.sec b/tests/keys/ed25519-2.sec index 059765f557e..059765f557e 100644 --- a/tests/ed25519bis.sec +++ b/tests/keys/ed25519-2.sec | |||
diff --git a/tests/keys/ed25519-3.pub b/tests/keys/ed25519-3.pub new file mode 100644 index 00000000000..72f311984c7 --- /dev/null +++ b/tests/keys/ed25519-3.pub | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- | ||
| 2 | |||
| 3 | mDMEYVH/7xYJKwYBBAHaRw8BAQdALMLeUhjEG2/UPCJj2j/debFwwAK5gT3G0l5d | ||
| 4 | ILfFldm0FTxleGFtcGxlQGV4YW1wbGUuY29tPoiWBBMWCAA+FiEEjO6M85jMSK68 | ||
| 5 | 7tINGBzA7NyoagkFAmFR/+8CGwMFCQPCZwAFCwkIBwIGFQoJCAsCBBYCAwECHgEC | ||
| 6 | F4AACgkQGBzA7Nyoagl3lgEAw6yqIlX11lTqwxBGhZk/Oy34O13cbJSZCGv+m0ja | ||
| 7 | +hcA/3DCNOmT+oXjgO/w6enQZUQ1m/d6dUjCc2wOLlLz+ZoG | ||
| 8 | =+r3i | ||
| 9 | -----END PGP PUBLIC KEY BLOCK----- | ||
diff --git a/tests/keys/ed25519-3.sec b/tests/keys/ed25519-3.sec new file mode 100644 index 00000000000..04128a41318 --- /dev/null +++ b/tests/keys/ed25519-3.sec | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | -----BEGIN PGP PRIVATE KEY BLOCK----- | ||
| 2 | |||
| 3 | lFgEYVH/7xYJKwYBBAHaRw8BAQdALMLeUhjEG2/UPCJj2j/debFwwAK5gT3G0l5d | ||
| 4 | ILfFldkAAP92goSbbzQ0ttElr9lr5Cm6rmQtqUZ2Cu/Jk9fvfZROwxI0tBU8ZXhh | ||
| 5 | bXBsZUBleGFtcGxlLmNvbT6IlgQTFggAPhYhBIzujPOYzEiuvO7SDRgcwOzcqGoJ | ||
| 6 | BQJhUf/vAhsDBQkDwmcABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEBgcwOzc | ||
| 7 | qGoJd5YBAMOsqiJV9dZU6sMQRoWZPzst+Dtd3GyUmQhr/ptI2voXAP9wwjTpk/qF | ||
| 8 | 44Dv8Onp0GVENZv3enVIwnNsDi5S8/maBg== | ||
| 9 | =EmOt | ||
| 10 | -----END PGP PRIVATE KEY BLOCK----- | ||
diff --git a/tests/ed25519.key b/tests/keys/ed25519.pub index f6bf906783a..f6bf906783a 100644 --- a/tests/ed25519.key +++ b/tests/keys/ed25519.pub | |||
diff --git a/tests/ed25519.sec b/tests/keys/ed25519.sec index 068738dfabd..068738dfabd 100644 --- a/tests/ed25519.sec +++ b/tests/keys/ed25519.sec | |||
diff --git a/tests/rsa.key b/tests/keys/rsa.pub index 0ef9145ef0d..0ef9145ef0d 100644 --- a/tests/rsa.key +++ b/tests/keys/rsa.pub | |||
diff --git a/tests/signing-key.pub b/tests/keys/signing-key.pub index 092424a15d2..092424a15d2 100644 --- a/tests/signing-key.pub +++ b/tests/keys/signing-key.pub | |||
diff --git a/tests/signing-key.sec b/tests/keys/signing-key.sec index 558e1891027..558e1891027 100644 --- a/tests/signing-key.sec +++ b/tests/keys/signing-key.sec | |||
diff --git a/tests/openpgp.scm b/tests/openpgp.scm index c2be26fa493..1f204667721 100644 --- a/tests/openpgp.scm +++ b/tests/openpgp.scm | |||
| @@ -59,18 +59,22 @@ vBSFjNSiVHsuAA== | |||
| 59 | (define %civodul-fingerprint | 59 | (define %civodul-fingerprint |
| 60 | "3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5") | 60 | "3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5") |
| 61 | 61 | ||
| 62 | (define %civodul-key-id #x090B11993D9AEBB5) ;civodul.key | 62 | (define %civodul-key-id #x090B11993D9AEBB5) ;civodul.pub |
| 63 | 63 | ||
| 64 | ;; Test keys. They were generated in a container along these lines: | 64 | #| |
| 65 | ;; guix environment -CP --ad-hoc gnupg pinentry | 65 | Test keys in ./tests/keys. They were generated in a container along these lines: |
| 66 | ;; then, within the container: | 66 | guix environment -CP --ad-hoc gnupg pinentry coreutils |
| 67 | ;; mkdir ~/.gnupg | 67 | then, within the container: |
| 68 | ;; echo pinentry-program ~/.guix-profile/bin/pinentry-tty > ~/.gnupg/gpg-agent.conf | 68 | mkdir ~/.gnupg && chmod -R og-rwx ~/.gnupg |
| 69 | ;; gpg --quick-gen-key '<ludo+test-rsa@chbouib.org>' rsa | 69 | gpg --batch --passphrase '' --quick-gen-key '<example@example.com>' ed25519 |
| 70 | ;; or similar. | 70 | gpg --armor --export example@example.com |
| 71 | (define %rsa-key-id #xAE25DA2A70DEED59) ;rsa.key | 71 | gpg --armor --export-secret-key example@example.com |
| 72 | (define %dsa-key-id #x587918047BE8BD2C) ;dsa.key | 72 | # echo pinentry-program ~/.guix-profile/bin/pinentry-curses > ~/.gnupg/gpg-agent.conf |
| 73 | (define %ed25519-key-id #x771F49CBFAAE072D) ;ed25519.key | 73 | or similar. |
| 74 | |# | ||
| 75 | (define %rsa-key-id #xAE25DA2A70DEED59) ;rsa.pub | ||
| 76 | (define %dsa-key-id #x587918047BE8BD2C) ;dsa.pub | ||
| 77 | (define %ed25519-key-id #x771F49CBFAAE072D) ;ed25519.pub | ||
| 74 | 78 | ||
| 75 | (define %rsa-key-fingerprint | 79 | (define %rsa-key-fingerprint |
| 76 | (base16-string->bytevector | 80 | (base16-string->bytevector |
| @@ -168,7 +172,7 @@ Pz7oopeN72xgggYUNT37ezqN3MeCqw0= | |||
| 168 | (not (port-ascii-armored? (open-bytevector-input-port %binary-sample)))) | 172 | (not (port-ascii-armored? (open-bytevector-input-port %binary-sample)))) |
| 169 | 173 | ||
| 170 | (test-assert "get-openpgp-keyring" | 174 | (test-assert "get-openpgp-keyring" |
| 171 | (let* ((key (search-path %load-path "tests/civodul.key")) | 175 | (let* ((key (search-path %load-path "tests/keys/civodul.pub")) |
| 172 | (keyring (get-openpgp-keyring | 176 | (keyring (get-openpgp-keyring |
| 173 | (open-bytevector-input-port | 177 | (open-bytevector-input-port |
| 174 | (call-with-input-file key read-radix-64))))) | 178 | (call-with-input-file key read-radix-64))))) |
| @@ -228,8 +232,10 @@ Pz7oopeN72xgggYUNT37ezqN3MeCqw0= | |||
| 228 | (verify-openpgp-signature signature keyring | 232 | (verify-openpgp-signature signature keyring |
| 229 | (open-input-string "Hello!\n")))) | 233 | (open-input-string "Hello!\n")))) |
| 230 | (list status (openpgp-public-key-id key))))) | 234 | (list status (openpgp-public-key-id key))))) |
| 231 | (list "tests/rsa.key" "tests/dsa.key" | 235 | (list "tests/keys/rsa.pub" "tests/keys/dsa.pub" |
| 232 | "tests/ed25519.key" "tests/ed25519.key" "tests/ed25519.key") | 236 | "tests/keys/ed25519.pub" |
| 237 | "tests/keys/ed25519.pub" | ||
| 238 | "tests/keys/ed25519.pub") | ||
| 233 | (list %hello-signature/rsa %hello-signature/dsa | 239 | (list %hello-signature/rsa %hello-signature/dsa |
| 234 | %hello-signature/ed25519/sha256 | 240 | %hello-signature/ed25519/sha256 |
| 235 | %hello-signature/ed25519/sha512 | 241 | %hello-signature/ed25519/sha512 |
| @@ -248,9 +254,9 @@ Pz7oopeN72xgggYUNT37ezqN3MeCqw0= | |||
| 248 | (call-with-input-file key read-radix-64)) | 254 | (call-with-input-file key read-radix-64)) |
| 249 | keyring))) | 255 | keyring))) |
| 250 | %empty-keyring | 256 | %empty-keyring |
| 251 | '("tests/rsa.key" "tests/dsa.key" | 257 | '("tests/keys/rsa.pub" "tests/keys/dsa.pub" |
| 252 | "tests/ed25519.key" "tests/ed25519.key" | 258 | "tests/keys/ed25519.pub" "tests/keys/ed25519.pub" |
| 253 | "tests/ed25519.key")))) | 259 | "tests/keys/ed25519.pub")))) |
| 254 | (map (lambda (signature) | 260 | (map (lambda (signature) |
| 255 | (let ((signature (string->openpgp-packet signature))) | 261 | (let ((signature (string->openpgp-packet signature))) |
| 256 | (let-values (((status key) | 262 | (let-values (((status key) |
