From 7ae23abc015fa72de86f3fe0b8c4d0d965495e0b Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Tue, 28 May 2019 11:47:01 -0700 Subject: [PATCH] test: move x25519 keypair 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/x25519_private.pem | 3 +++ test/fixtures/keys/x25519_public.pem | 3 +++ test/fixtures/test_x25519_privkey.pem | 3 --- test/fixtures/test_x25519_pubkey.pem | 3 --- test/parallel/test-crypto-key-objects.js | 4 ++-- 6 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 test/fixtures/keys/x25519_private.pem create mode 100644 test/fixtures/keys/x25519_public.pem delete mode 100644 test/fixtures/test_x25519_privkey.pem delete mode 100644 test/fixtures/test_x25519_pubkey.pem diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index 72a0cb5718511b..85253ad967b0d5 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -45,6 +45,8 @@ all: \ rsa_pss_public_2048_sha512_sha256_20.pem \ ed25519_private.pem \ ed25519_public.pem \ + x25519_private.pem \ + x25519_public.pem \ # # Create Certificate Authority: ca1 @@ -606,6 +608,12 @@ ed25519_private.pem: ed25519_public.pem: ed25519_private.pem openssl pkey -in ed25519_private.pem -pubout -out ed25519_public.pem +x25519_private.pem: + openssl genpkey -algorithm x25519 -out x25519_private.pem + +x25519_public.pem: x25519_private.pem + openssl pkey -in x25519_private.pem -pubout -out x25519_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/x25519_private.pem b/test/fixtures/keys/x25519_private.pem new file mode 100644 index 00000000000000..926c4e3a2b669a --- /dev/null +++ b/test/fixtures/keys/x25519_private.pem @@ -0,0 +1,3 @@ +-----BEGIN PRIVATE KEY----- +MC4CAQAwBQYDK2VuBCIEIJi/yFpueUawC1BkXyWM8ONIBGFjL7UZHrD/Zo/KPDpn +-----END PRIVATE KEY----- diff --git a/test/fixtures/keys/x25519_public.pem b/test/fixtures/keys/x25519_public.pem new file mode 100644 index 00000000000000..e2d756bd17c83f --- /dev/null +++ b/test/fixtures/keys/x25519_public.pem @@ -0,0 +1,3 @@ +-----BEGIN PUBLIC KEY----- +MCowBQYDK2VuAyEAaSb8Q+RndwfNnPeOYGYPDUN3uhAPnMLzXyfi+mqfhig= +-----END PUBLIC KEY----- diff --git a/test/fixtures/test_x25519_privkey.pem b/test/fixtures/test_x25519_privkey.pem deleted file mode 100644 index b2f60cca40e547..00000000000000 --- a/test/fixtures/test_x25519_privkey.pem +++ /dev/null @@ -1,3 +0,0 @@ ------BEGIN PRIVATE KEY----- -MC4CAQAwBQYDK2VuBCIEILD/13Y5R/tmcCjZVSooIcpfGvZxf+qt6dMu5FYaOC1a ------END PRIVATE KEY----- diff --git a/test/fixtures/test_x25519_pubkey.pem b/test/fixtures/test_x25519_pubkey.pem deleted file mode 100644 index 3d1e7b835e14ec..00000000000000 --- a/test/fixtures/test_x25519_pubkey.pem +++ /dev/null @@ -1,3 +0,0 @@ ------BEGIN PUBLIC KEY----- -MCowBQYDK2VuAyEAYHCXnz085FKclfnx+gdiGXAyy7BhJjx0pxyE4wbXF0A= ------END PUBLIC KEY----- diff --git a/test/parallel/test-crypto-key-objects.js b/test/parallel/test-crypto-key-objects.js index 0ec7dc1d74c70d..747bb7c64d5163 100644 --- a/test/parallel/test-crypto-key-objects.js +++ b/test/parallel/test-crypto-key-objects.js @@ -209,8 +209,8 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', { private: fixtures.readSync('test_ed448_privkey.pem', 'ascii'), public: fixtures.readSync('test_ed448_pubkey.pem', 'ascii'), keyType: 'ed448' }, - { private: fixtures.readSync('test_x25519_privkey.pem', 'ascii'), - public: fixtures.readSync('test_x25519_pubkey.pem', 'ascii'), + { 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'),