mirror of
https://codeberg.org/guix/guix.git
synced 2026-04-28 06:34:05 +00:00
tests: keys: Moving to openpgp subdirectory.
* tests/keys/*.(pub|sec): Move to tests/keys/openpgp/*.(pub|sec) * build-aux/test-env.in: Adapt accordingly. * Makefile.am: Likewise. * guix/tests/gnupg.scm: Likewise. * tests/guix-authenticate.sh: Likewise. * tests/openpgp.scm: Likewise. Change-Id: If8897cec9851cc51a4ebadcc5927dc0e0520b881 Reviewed-by: Danny Milosavljevic <dannym@friendly-machines.com> Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
This commit is contained in:
committed by
Nguyễn Gia Phong
parent
4cbd5f883d
commit
4c7a7a1d49
22
Makefile.am
22
Makefile.am
@@ -802,17 +802,17 @@ EXTRA_DIST += \
|
|||||||
etc/manifests/upgrade.scm \
|
etc/manifests/upgrade.scm \
|
||||||
scripts/guix.in \
|
scripts/guix.in \
|
||||||
tests/cve-sample.json \
|
tests/cve-sample.json \
|
||||||
tests/keys/civodul.pub \
|
tests/keys/openpgp/civodul.pub \
|
||||||
tests/keys/dsa.pub \
|
tests/keys/openpgp/dsa.pub \
|
||||||
tests/keys/ed25519-2.pub \
|
tests/keys/openpgp/ed25519-2.pub \
|
||||||
tests/keys/ed25519-2.sec \
|
tests/keys/openpgp/ed25519-2.sec \
|
||||||
tests/keys/ed25519-3.pub \
|
tests/keys/openpgp/ed25519-3.pub \
|
||||||
tests/keys/ed25519-3.sec \
|
tests/keys/openpgp/ed25519-3.sec \
|
||||||
tests/keys/ed25519.pub \
|
tests/keys/openpgp/ed25519.pub \
|
||||||
tests/keys/ed25519.sec \
|
tests/keys/openpgp/ed25519.sec \
|
||||||
tests/keys/rsa.pub \
|
tests/keys/openpgp/rsa.pub \
|
||||||
tests/keys/signing-key.pub \
|
tests/keys/openpgp/signing-key.pub \
|
||||||
tests/keys/signing-key.sec \
|
tests/keys/openpgp/signing-key.sec \
|
||||||
tests/test.drv \
|
tests/test.drv \
|
||||||
$(TESTS)
|
$(TESTS)
|
||||||
|
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ then
|
|||||||
# Copy the keys so that the secret key has the right permissions (the
|
# Copy the keys so that the secret key has the right permissions (the
|
||||||
# daemon errors out when this is not the case.)
|
# daemon errors out when this is not the case.)
|
||||||
mkdir -p "$GUIX_CONFIGURATION_DIRECTORY"
|
mkdir -p "$GUIX_CONFIGURATION_DIRECTORY"
|
||||||
cp "@abs_top_srcdir@/tests/keys/signing-key.sec" \
|
cp "@abs_top_srcdir@/tests/keys/openpgp/signing-key.sec" \
|
||||||
"@abs_top_srcdir@/tests/keys/signing-key.pub" \
|
"@abs_top_srcdir@/tests/keys/openpgp/signing-key.pub" \
|
||||||
"$GUIX_CONFIGURATION_DIRECTORY"
|
"$GUIX_CONFIGURATION_DIRECTORY"
|
||||||
chmod 400 "$GUIX_CONFIGURATION_DIRECTORY/signing-key.sec"
|
chmod 400 "$GUIX_CONFIGURATION_DIRECTORY/signing-key.sec"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -65,17 +65,17 @@ process is terminated afterwards."
|
|||||||
(call-with-fresh-gnupg-setup imported (lambda () exp ...)))
|
(call-with-fresh-gnupg-setup imported (lambda () exp ...)))
|
||||||
|
|
||||||
(define %ed25519-public-key-file
|
(define %ed25519-public-key-file
|
||||||
(search-path %load-path "tests/keys/ed25519.pub"))
|
(search-path %load-path "tests/keys/openpgp/ed25519.pub"))
|
||||||
(define %ed25519-secret-key-file
|
(define %ed25519-secret-key-file
|
||||||
(search-path %load-path "tests/keys/ed25519.sec"))
|
(search-path %load-path "tests/keys/openpgp/ed25519.sec"))
|
||||||
(define %ed25519-2-public-key-file
|
(define %ed25519-2-public-key-file
|
||||||
(search-path %load-path "tests/keys/ed25519-2.pub"))
|
(search-path %load-path "tests/keys/openpgp/ed25519-2.pub"))
|
||||||
(define %ed25519-2-secret-key-file
|
(define %ed25519-2-secret-key-file
|
||||||
(search-path %load-path "tests/keys/ed25519-2.sec"))
|
(search-path %load-path "tests/keys/openpgp/ed25519-2.sec"))
|
||||||
(define %ed25519-3-public-key-file
|
(define %ed25519-3-public-key-file
|
||||||
(search-path %load-path "tests/keys/ed25519-3.pub"))
|
(search-path %load-path "tests/keys/openpgp/ed25519-3.pub"))
|
||||||
(define %ed25519-3-secret-key-file
|
(define %ed25519-3-secret-key-file
|
||||||
(search-path %load-path "tests/keys/ed25519-3.sec"))
|
(search-path %load-path "tests/keys/openpgp/ed25519-3.sec"))
|
||||||
|
|
||||||
(define (read-openpgp-packet file)
|
(define (read-openpgp-packet file)
|
||||||
(get-openpgp-packet
|
(get-openpgp-packet
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ rm -f "$sig" "$hash"
|
|||||||
|
|
||||||
trap 'rm -f "$sig" "$hash"' EXIT
|
trap 'rm -f "$sig" "$hash"' EXIT
|
||||||
|
|
||||||
key="$abs_top_srcdir/tests/keys/signing-key.sec"
|
key="$abs_top_srcdir/tests/keys/openpgp/signing-key.sec"
|
||||||
key_len="`echo -n $key | wc -c`"
|
key_len="`echo -n $key | wc -c`"
|
||||||
|
|
||||||
# A hexadecimal string as long as a sha256 hash.
|
# A hexadecimal string as long as a sha256 hash.
|
||||||
@@ -67,7 +67,7 @@ test "$code" -ne 0
|
|||||||
# encoded independently of the current locale: <https://bugs.gnu.org/43421>.
|
# encoded independently of the current locale: <https://bugs.gnu.org/43421>.
|
||||||
hash="636166e9636166e9636166e9636166e9636166e9636166e9636166e9636166e9"
|
hash="636166e9636166e9636166e9636166e9636166e9636166e9636166e9636166e9"
|
||||||
latin1_cafe="caf$(printf '\351')"
|
latin1_cafe="caf$(printf '\351')"
|
||||||
echo "sign 26:tests/keys/signing-key.sec 64:$hash" | guix authenticate \
|
echo "sign 34:tests/keys/openpgp/signing-key.sec 64:$hash" | guix authenticate \
|
||||||
| LC_ALL=C grep "hash sha256 \"$latin1_cafe"
|
| LC_ALL=C grep "hash sha256 \"$latin1_cafe"
|
||||||
|
|
||||||
# Test for <http://bugs.gnu.org/17312>: make sure 'guix authenticate' produces
|
# Test for <http://bugs.gnu.org/17312>: make sure 'guix authenticate' produces
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ Pz7oopeN72xgggYUNT37ezqN3MeCqw0=
|
|||||||
(not (port-ascii-armored? (open-bytevector-input-port %binary-sample))))
|
(not (port-ascii-armored? (open-bytevector-input-port %binary-sample))))
|
||||||
|
|
||||||
(test-assert "get-openpgp-keyring"
|
(test-assert "get-openpgp-keyring"
|
||||||
(let* ((key (search-path %load-path "tests/keys/civodul.pub"))
|
(let* ((key (search-path %load-path "tests/keys/openpgp/civodul.pub"))
|
||||||
(keyring (get-openpgp-keyring
|
(keyring (get-openpgp-keyring
|
||||||
(open-bytevector-input-port
|
(open-bytevector-input-port
|
||||||
(call-with-input-file key read-radix-64)))))
|
(call-with-input-file key read-radix-64)))))
|
||||||
@@ -232,10 +232,11 @@ Pz7oopeN72xgggYUNT37ezqN3MeCqw0=
|
|||||||
(verify-openpgp-signature signature keyring
|
(verify-openpgp-signature signature keyring
|
||||||
(open-input-string "Hello!\n"))))
|
(open-input-string "Hello!\n"))))
|
||||||
(list status (openpgp-public-key-id key)))))
|
(list status (openpgp-public-key-id key)))))
|
||||||
(list "tests/keys/rsa.pub" "tests/keys/dsa.pub"
|
(list "tests/keys/openpgp/rsa.pub"
|
||||||
"tests/keys/ed25519.pub"
|
"tests/keys/openpgp/dsa.pub"
|
||||||
"tests/keys/ed25519.pub"
|
"tests/keys/openpgp/ed25519.pub"
|
||||||
"tests/keys/ed25519.pub")
|
"tests/keys/openpgp/ed25519.pub"
|
||||||
|
"tests/keys/openpgp/ed25519.pub")
|
||||||
(list %hello-signature/rsa %hello-signature/dsa
|
(list %hello-signature/rsa %hello-signature/dsa
|
||||||
%hello-signature/ed25519/sha256
|
%hello-signature/ed25519/sha256
|
||||||
%hello-signature/ed25519/sha512
|
%hello-signature/ed25519/sha512
|
||||||
@@ -254,9 +255,11 @@ Pz7oopeN72xgggYUNT37ezqN3MeCqw0=
|
|||||||
(call-with-input-file key read-radix-64))
|
(call-with-input-file key read-radix-64))
|
||||||
keyring)))
|
keyring)))
|
||||||
%empty-keyring
|
%empty-keyring
|
||||||
'("tests/keys/rsa.pub" "tests/keys/dsa.pub"
|
'("tests/keys/openpgp/rsa.pub"
|
||||||
"tests/keys/ed25519.pub" "tests/keys/ed25519.pub"
|
"tests/keys/openpgp/dsa.pub"
|
||||||
"tests/keys/ed25519.pub"))))
|
"tests/keys/openpgp/ed25519.pub"
|
||||||
|
"tests/keys/openpgp/ed25519.pub"
|
||||||
|
"tests/keys/openpgp/ed25519.pub"))))
|
||||||
(map (lambda (signature)
|
(map (lambda (signature)
|
||||||
(let ((signature (string->openpgp-packet signature)))
|
(let ((signature (string->openpgp-packet signature)))
|
||||||
(let-values (((status key)
|
(let-values (((status key)
|
||||||
|
|||||||
Reference in New Issue
Block a user