From 7d1f15fba1550161c159b6ebea0593984b8a96ea Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Tue, 28 May 2019 16:39:49 -0700 Subject: [PATCH] test: move x448 keypairs to fixtures/keys/ PR-URL: https://github.com/nodejs/node/pull/27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/keys/Makefile | 8 ++++++++ test/fixtures/keys/x448_private.pem | 4 ++++ test/fixtures/keys/x448_public.pem | 4 ++++ test/fixtures/test_x448_privkey.pem | 4 ---- test/fixtures/test_x448_pubkey.pem | 4 ---- test/parallel/test-crypto-key-objects.js | 6 +++--- 6 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 test/fixtures/keys/x448_private.pem create mode 100644 test/fixtures/keys/x448_public.pem delete mode 100644 test/fixtures/test_x448_privkey.pem delete mode 100644 test/fixtures/test_x448_pubkey.pem diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index f12664908f6f19..8ca9e4d26c17f6 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -64,6 +64,8 @@ all: \ x25519_public.pem \ ed448_private.pem \ ed448_public.pem \ + x448_private.pem \ + x448_public.pem \ # # Create Certificate Authority: ca1 @@ -682,6 +684,12 @@ ed448_private.pem: ed448_public.pem: ed448_private.pem openssl pkey -in ed448_private.pem -pubout -out ed448_public.pem +x448_private.pem: + openssl genpkey -algorithm x448 -out x448_private.pem + +x448_public.pem: x448_private.pem + openssl pkey -in x448_private.pem -pubout -out x448_public.pem + clean: rm -f *.pfx *.pem *.srl ca2-database.txt ca2-serial fake-startcom-root-serial *.print *.old fake-startcom-root-issued-certs/*.pem @> fake-startcom-root-database.txt diff --git a/test/fixtures/keys/x448_private.pem b/test/fixtures/keys/x448_private.pem new file mode 100644 index 00000000000000..61cd52c3989105 --- /dev/null +++ b/test/fixtures/keys/x448_private.pem @@ -0,0 +1,4 @@ +-----BEGIN PRIVATE KEY----- +MEYCAQAwBQYDK2VvBDoEOLTDbazv6vHZWOmODQ3kk8TUOQgApB4j75rpInT5zSLl +/xJHK8ixF7f+4uo+mGTCrK1sktI5UmCZ +-----END PRIVATE KEY----- diff --git a/test/fixtures/keys/x448_public.pem b/test/fixtures/keys/x448_public.pem new file mode 100644 index 00000000000000..6475d0438042d5 --- /dev/null +++ b/test/fixtures/keys/x448_public.pem @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MEIwBQYDK2VvAzkAioHSHVpTs6hMvghosEJDIR7ceFiE3+Xccxati64oOVJ7NWjf +ozE7ae31PXIUFq6cVYgvSKsDFPA= +-----END PUBLIC KEY----- diff --git a/test/fixtures/test_x448_privkey.pem b/test/fixtures/test_x448_privkey.pem deleted file mode 100644 index 39c507d2b8d5d6..00000000000000 --- a/test/fixtures/test_x448_privkey.pem +++ /dev/null @@ -1,4 +0,0 @@ ------BEGIN PRIVATE KEY----- -MEYCAQAwBQYDK2VvBDoEOPilLIAZTQqUbFb0LhTGaqn47zN2p2yGVk+2hhQQk9C8 -8SvFqEFw73YITSIJ2NUBZnZKNz2nGkrm ------END PRIVATE KEY----- diff --git a/test/fixtures/test_x448_pubkey.pem b/test/fixtures/test_x448_pubkey.pem deleted file mode 100644 index 841c2bb66b5bfd..00000000000000 --- a/test/fixtures/test_x448_pubkey.pem +++ /dev/null @@ -1,4 +0,0 @@ ------BEGIN PUBLIC KEY----- -MEIwBQYDK2VvAzkAbceBBM+LkveTK09QojZdnHokCh7lOWxyVZrlbH3Ny3WorprD -Iir5A6heZzlRnz1elOHp7ZpPfWk= ------END PUBLIC KEY----- diff --git a/test/parallel/test-crypto-key-objects.js b/test/parallel/test-crypto-key-objects.js index 12c3ba4ff1ef94..558f7dc1f4b673 100644 --- a/test/parallel/test-crypto-key-objects.js +++ b/test/parallel/test-crypto-key-objects.js @@ -212,9 +212,9 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', { private: fixtures.readKey('x25519_private.pem', 'ascii'), public: fixtures.readKey('x25519_public.pem', 'ascii'), keyType: 'x25519' }, - { private: fixtures.readSync('test_x448_privkey.pem', 'ascii'), - public: fixtures.readSync('test_x448_pubkey.pem', 'ascii'), - keyType: 'x448' } + { private: fixtures.readKey('x448_private.pem', 'ascii'), + public: fixtures.readKey('x448_public.pem', 'ascii'), + keyType: 'x448' }, ].forEach((info) => { const keyType = info.keyType;