From 3922f69fda8094cd09bdb440dc9a24f6119441ce Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Tue, 28 May 2019 11:39:24 -0700 Subject: [PATCH 01/17] test: move ed25519 keypair to fixtures/keys/ PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/keys/.gitattributes | 4 ++++ test/fixtures/keys/Makefile | 8 ++++++++ test/fixtures/keys/ed25519_private.pem | 3 +++ test/fixtures/keys/ed25519_public.pem | 3 +++ test/fixtures/test_ed25519_privkey.pem | 3 --- test/fixtures/test_ed25519_pubkey.pem | 3 --- test/parallel/test-crypto-key-objects.js | 4 ++-- test/parallel/test-crypto-sign-verify.js | 4 ++-- 8 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 test/fixtures/keys/.gitattributes create mode 100644 test/fixtures/keys/ed25519_private.pem create mode 100644 test/fixtures/keys/ed25519_public.pem delete mode 100644 test/fixtures/test_ed25519_privkey.pem delete mode 100644 test/fixtures/test_ed25519_pubkey.pem diff --git a/test/fixtures/keys/.gitattributes b/test/fixtures/keys/.gitattributes new file mode 100644 index 00000000000000..87a4fb14e41aaa --- /dev/null +++ b/test/fixtures/keys/.gitattributes @@ -0,0 +1,4 @@ +* -text + +Makefile text +*.cnf text diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index 81fe36a81331eb..72a0cb5718511b 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -43,6 +43,8 @@ all: \ rsa_pss_public_2048.pem \ rsa_pss_public_2048_sha256_sha256_16.pem \ rsa_pss_public_2048_sha512_sha256_20.pem \ + ed25519_private.pem \ + ed25519_public.pem \ # # Create Certificate Authority: ca1 @@ -598,6 +600,12 @@ rsa_pss_public_2048_sha256_sha256_16.pem: rsa_pss_private_2048_sha256_sha256_16. rsa_pss_public_2048_sha512_sha256_20.pem: rsa_pss_private_2048_sha512_sha256_20.pem openssl pkey -in rsa_pss_private_2048_sha512_sha256_20.pem -pubout -out rsa_pss_public_2048_sha512_sha256_20.pem +ed25519_private.pem: + openssl genpkey -algorithm ED25519 -out ed25519_private.pem + +ed25519_public.pem: ed25519_private.pem + openssl pkey -in ed25519_private.pem -pubout -out ed25519_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/ed25519_private.pem b/test/fixtures/keys/ed25519_private.pem new file mode 100644 index 00000000000000..f837457cbd4f23 --- /dev/null +++ b/test/fixtures/keys/ed25519_private.pem @@ -0,0 +1,3 @@ +-----BEGIN PRIVATE KEY----- +MC4CAQAwBQYDK2VwBCIEIMFSujN0jIUIdzSvuxka0lfgVVkMdRTuaVvIYUHrvzXQ +-----END PRIVATE KEY----- diff --git a/test/fixtures/keys/ed25519_public.pem b/test/fixtures/keys/ed25519_public.pem new file mode 100644 index 00000000000000..4127a471bac9f5 --- /dev/null +++ b/test/fixtures/keys/ed25519_public.pem @@ -0,0 +1,3 @@ +-----BEGIN PUBLIC KEY----- +MCowBQYDK2VwAyEAK1wIouqnuiA04b3WrMa+xKIKIpfHetNZRv3h9fBf768= +-----END PUBLIC KEY----- diff --git a/test/fixtures/test_ed25519_privkey.pem b/test/fixtures/test_ed25519_privkey.pem deleted file mode 100644 index a8b9f2f603f03a..00000000000000 --- a/test/fixtures/test_ed25519_privkey.pem +++ /dev/null @@ -1,3 +0,0 @@ ------BEGIN PRIVATE KEY----- -MC4CAQAwBQYDK2VwBCIEIHXLsXm1lsq5HtyqJwQyFmpfEluuf0KOqP6DqMgGxxDL ------END PRIVATE KEY----- diff --git a/test/fixtures/test_ed25519_pubkey.pem b/test/fixtures/test_ed25519_pubkey.pem deleted file mode 100644 index b9657c9d08d050..00000000000000 --- a/test/fixtures/test_ed25519_pubkey.pem +++ /dev/null @@ -1,3 +0,0 @@ ------BEGIN PUBLIC KEY----- -MCowBQYDK2VwAyEAEXRYV3v5ucrHVR3mKqyPXxXqU34lASwc7Y7MoOvaqcs= ------END PUBLIC KEY----- diff --git a/test/parallel/test-crypto-key-objects.js b/test/parallel/test-crypto-key-objects.js index 2a3a3ec2f0bff1..0ec7dc1d74c70d 100644 --- a/test/parallel/test-crypto-key-objects.js +++ b/test/parallel/test-crypto-key-objects.js @@ -203,8 +203,8 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', } [ - { private: fixtures.readSync('test_ed25519_privkey.pem', 'ascii'), - public: fixtures.readSync('test_ed25519_pubkey.pem', 'ascii'), + { private: fixtures.readKey('ed25519_private.pem', 'ascii'), + public: fixtures.readKey('ed25519_public.pem', 'ascii'), keyType: 'ed25519' }, { private: fixtures.readSync('test_ed448_privkey.pem', 'ascii'), public: fixtures.readSync('test_ed448_pubkey.pem', 'ascii'), diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js index 062c2d08377cfe..2da2a91655cfdd 100644 --- a/test/parallel/test-crypto-sign-verify.js +++ b/test/parallel/test-crypto-sign-verify.js @@ -418,8 +418,8 @@ common.expectsError( } [ - { private: fixtures.readSync('test_ed25519_privkey.pem', 'ascii'), - public: fixtures.readSync('test_ed25519_pubkey.pem', 'ascii'), + { private: fixtures.readKey('ed25519_private.pem', 'ascii'), + public: fixtures.readKey('ed25519_public.pem', 'ascii'), algo: null, sigLen: 64 }, { private: fixtures.readSync('test_ed448_privkey.pem', 'ascii'), From efd2d7ed031ff96ebe845460ab2ff9a7580f3769 Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Tue, 28 May 2019 11:47:01 -0700 Subject: [PATCH 02/17] test: move x25519 keypair to fixtures/keys/ PR-URL: #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'), From 53e3e65f63b398a1f15b289c7217d88685eade49 Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Tue, 28 May 2019 14:11:45 -0700 Subject: [PATCH 03/17] test: move rsa keypairs to fixtures/keys/ Also adds make'd signatures for use in tests of signing/verification. All of the moved keys can be regenerated at will without breaking tests now. PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- ...56_signature_signedby_rsa_private_b.sha256 | Bin 0 -> 256 bytes test/fixtures/keys/Makefile | 40 ++++++++++++++++ test/fixtures/keys/rsa_private.pem | 27 +++++++++++ test/fixtures/keys/rsa_private_b.pem | 27 +++++++++++ test/fixtures/keys/rsa_private_encrypted.pem | 30 ++++++++++++ test/fixtures/keys/rsa_private_pkcs8.pem | 28 ++++++++++++ test/fixtures/keys/rsa_private_pkcs8_bad.pem | 28 ++++++++++++ test/fixtures/keys/rsa_public.pem | 9 ++++ test/fixtures/keys/rsa_public_b.pem | 9 ++++ ...c_sha1_signature_signedby_rsa_private.sha1 | 2 + ..._signature_signedby_rsa_private_pkcs8.sha1 | 2 + test/fixtures/test_bad_rsa_privkey.pem | 10 ---- test/fixtures/test_rsa_pkcs8_privkey.pem | 16 ------- test/fixtures/test_rsa_privkey.pem | 15 ------ test/fixtures/test_rsa_privkey_2.pem | 15 ------ test/fixtures/test_rsa_privkey_encrypted.pem | 17 ------- test/fixtures/test_rsa_pubkey.pem | 6 --- test/fixtures/test_rsa_pubkey_2.pem | 5 -- test/parallel/test-crypto-binary-default.js | 29 +++++------- test/parallel/test-crypto-key-objects.js | 4 +- test/parallel/test-crypto-rsa-dsa.js | 43 ++++++++---------- test/parallel/test-crypto.js | 11 ++--- 22 files changed, 239 insertions(+), 134 deletions(-) create mode 100644 test/fixtures/keys/I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256 create mode 100644 test/fixtures/keys/rsa_private.pem create mode 100644 test/fixtures/keys/rsa_private_b.pem create mode 100644 test/fixtures/keys/rsa_private_encrypted.pem create mode 100644 test/fixtures/keys/rsa_private_pkcs8.pem create mode 100644 test/fixtures/keys/rsa_private_pkcs8_bad.pem create mode 100644 test/fixtures/keys/rsa_public.pem create mode 100644 test/fixtures/keys/rsa_public_b.pem create mode 100644 test/fixtures/keys/rsa_public_sha1_signature_signedby_rsa_private.sha1 create mode 100644 test/fixtures/keys/rsa_public_sha1_signature_signedby_rsa_private_pkcs8.sha1 delete mode 100644 test/fixtures/test_bad_rsa_privkey.pem delete mode 100644 test/fixtures/test_rsa_pkcs8_privkey.pem delete mode 100644 test/fixtures/test_rsa_privkey.pem delete mode 100644 test/fixtures/test_rsa_privkey_2.pem delete mode 100644 test/fixtures/test_rsa_privkey_encrypted.pem delete mode 100644 test/fixtures/test_rsa_pubkey.pem delete mode 100644 test/fixtures/test_rsa_pubkey_2.pem diff --git a/test/fixtures/keys/I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256 b/test/fixtures/keys/I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256 new file mode 100644 index 0000000000000000000000000000000000000000..59eb6c7c8831cc21f840333ef9b1fd375997969e GIT binary patch literal 256 zcmV+b0ssCa`<*sOtJZ2_Xso%22DtCR2=2O46@e(%w`g0WQup7IIJApcZ^}TeJ#Wkq zV`aA)8anIRgMvQXTus&?Pku}yJzz4U(i-#tP?~8T>FH!KK*NFD;GH1zfk(ftAO{6W z%J>u4hmn(!5@)Aqyt(dyuVg=+HJ@I6j)2da{z5wKI_T_qi8Ui=mq#ILj*w_vtdv9k zcJ0?Q5I7u7R@C!qbI2e*WnGM@ZEfmL%l^*?HDw*2v41)Oho&$)*G7*F2%F*$iwS;-5}QR8`Y^#%RKg+hC6Rnu7TKAP?aKwGco0 GrD6ik<9l}i literal 0 HcmV?d00001 diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index 85253ad967b0d5..c51991575edcf7 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -31,6 +31,16 @@ all: \ ec-cert.pem \ ec.pfx \ fake-cnnic-root-cert.pem \ + rsa_private.pem \ + rsa_private_encrypted.pem \ + rsa_private_pkcs8.pem \ + rsa_private_pkcs8_bad.pem \ + rsa_public.pem \ + rsa_public_sha1_signature_signedby_rsa_private.sha1 \ + rsa_public_sha1_signature_signedby_rsa_private_pkcs8.sha1 \ + rsa_private_b.pem \ + I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256 \ + rsa_public_b.pem \ rsa_private_1024.pem \ rsa_private_2048.pem \ rsa_private_4096.pem \ @@ -566,6 +576,36 @@ dsa_private_encrypted_1025.pem: dsa_public_1025.pem: openssl dsa -in dsa_private_1025.pem -pubout -out dsa_public_1025.pem +rsa_private.pem: + openssl genrsa -out rsa_private.pem 2048 + +rsa_private_encrypted.pem: rsa_private.pem + openssl rsa -aes256 -in rsa_private.pem -passout 'pass:password' -out rsa_private_encrypted.pem + +rsa_private_pkcs8.pem: rsa_private.pem + openssl pkcs8 -topk8 -inform PEM -outform PEM -in rsa_private.pem -out rsa_private_pkcs8.pem -nocrypt + +rsa_private_pkcs8_bad.pem: rsa_private_pkcs8.pem + sed 's/PRIVATE/RSA PRIVATE/g' rsa_private_pkcs8.pem > rsa_private_pkcs8_bad.pem + +rsa_public.pem: rsa_private.pem + openssl rsa -in rsa_private.pem -pubout -out rsa_public.pem + +rsa_public_sha1_signature_signedby_rsa_private.sha1: rsa_public.pem rsa_private.pem + openssl dgst -sha1 -sign rsa_private.pem -out rsa_public_sha1_signature_signedby_rsa_private.sha1 rsa_public.pem + +rsa_public_sha1_signature_signedby_rsa_private_pkcs8.sha1: rsa_public.pem rsa_private_pkcs8.pem + openssl dgst -sha1 -sign rsa_private_pkcs8.pem -out rsa_public_sha1_signature_signedby_rsa_private_pkcs8.sha1 rsa_public.pem + +rsa_private_b.pem: + openssl genrsa -out rsa_private_b.pem 2048 + +I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256: rsa_private_b.pem + echo -n "I AM THE WALRUS" | openssl dgst -sha256 -sign rsa_private_b.pem -out I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256 + +rsa_public_b.pem: rsa_private_b.pem + openssl rsa -in rsa_private_b.pem -pubout -out rsa_public_b.pem + rsa_private_1024.pem: openssl genrsa -out rsa_private_1024.pem 1024 diff --git a/test/fixtures/keys/rsa_private.pem b/test/fixtures/keys/rsa_private.pem new file mode 100644 index 00000000000000..215e5cc5131251 --- /dev/null +++ b/test/fixtures/keys/rsa_private.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEAt9xYiIonscC3vz/A2ceR7KhZZlDu/5bye53nCVTcKnWd2seY +6UAdKersX6njr83Dd5OVe1BW/wJvp5EjWTAGYbFswlNmeD44edEGM939B6Lq+/8i +BkrTi8mGN4YCytivE24YI0D4XZMPfkLSpab2y/Hy4DjQKBq1ThZ0UBnK+9IhX37J +u/ZoGYSlTIGIhzyaiYBh7wrZBoPczIEu6et/kN2VnnbRUtkYTF97ggcv5h+hDpUQ +jQW0ZgOMcTc8n+RkGpIt0/iM/bTjI3Tz/gsFdi6hHcpZgbopPL630296iByyigQC +PJVzdusFrQN5DeC+zT/nGypQkZanLb4ZspSx9QIDAQABAoIBAQCS2erYu8gyoGPi +3E/zYgQ6ishFAZWzDWSFubwD5wSm4SSAzvViL/RbO6kqS25xR569DmLRiHzD17VI +mJMsNECUnPrqR2TL256OJZaXrNHh3I1lUwVhEzjeKMsL4/ys+d70XPXoiocVblVs +moDXEIGEqa48ywPvVE3Fngeuxrsq3/GCVBNiwtt0YjAOZxmKEh31UZdHO+YI+wNF +/Z8KQCPscN5HGlR0SIQOlqMANz49aKStrevdvjS1UcpabzDEkuK84g3saJhcpAhb +pGFmAf5GTjkkhE0rE1qDF15dSqrKGfCFtOjUeK17SIEN7E322ChmTReZ1hYGfoSV +cdFntUINAoGBAPFKL5QeJ6wZu8R/ru11wTG6sQA0Jub2hGccPXpbnPrT+3CACOLI +JTCLy/xTKW3dqRHj/wZEe+jUw88w7jwGb1BkWr4BI8tDvY9jQLP1jyuLWRfrxXbp +4Z0oeBBwBeCI/ZG7FIvdDTqWxn1aj3Tmh6s4ByqEdtwrrrJPcBUNl01fAoGBAMMR +3RGE/ca6X6xz6kgUD6TtHVhiiRJK1jm/u+q0n7i/MBkeDgTZkHYS7lPc0yIdtqaI +Plz5yzwHnAvuMrv8LSdkjwioig2yQa3tAij8kXxqs7wN5418DMV2s1OJBrPthYPs +bv4im2iI8V63JQS4ZMYQbckq8ABYccTpOnxXDy0rAoGBAKkvzHa+QjERhjB9GyoT +1FhLQIsVBmYSWrp1+cGO9V6HPxoeHJzvm+wTSf/uS/FmaINL6+j4Ii4a6gWgmJts +I6cqBtqNsAx5vjQJczf8KdxthBYa0sXTrsfktXNJKUXMqIgDtp9vazQ2vozs8AQX +FPAAhD3SzgkJdCBBRSTt97ZfAoGAWAziKpxLKL7LnL4dzDcx8JIPIuwnTxh0plCD +dCffyLaT8WJ9lXbXHFTjOvt8WfPrlDP/Ylxmfkw5BbGZOP1VLGjZn2DkH9aMiwNm +bDXFPdG0G3hzQovx/9fajiRV4DWghLHeT9wzJfZabRRiI0VQR472300AVEeX4vgb +rDBn600CgYEAk7czBCT9rHn/PNwCa17hlTy88C4vXkwbz83Oa+aX5L4e5gw5lhcR +2ZuZHLb2r6oMt9rlD7EIDItSs+u21LOXWPTAlazdnpYUyw/CzogM/PN+qNwMRXn5 +uXFFhmlP2mVg2EdELTahXch8kWqHaCSX53yvqCtRKu/j76V31TfQZGM= +-----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/rsa_private_b.pem b/test/fixtures/keys/rsa_private_b.pem new file mode 100644 index 00000000000000..96d82ae2e24a3c --- /dev/null +++ b/test/fixtures/keys/rsa_private_b.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAyb1grrN+29fxeeEbTaSEja6TKDTpT/WXnqrFCS+h7IYcnDoA +VwcsPU5FZeUPvLKMzi9NHSJ34LQCurqHgH8X+cw0YT3gdYS/7qoQiXs+zKv615Nc +ttD3xlQLceY+NwznoPXyyZwOeZqyU5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BTNhGFa +Dp9L0x+TBSvsW4t2SjYDCjA5AoGASzxxGWVWd7gFzWrmGuOD9pkwvkLzA3yZJwjx +8EkK+eJVAeAWic5WluBUzi43v7k/U9BRWYXUd2nDvEuziZ/iWXwfGSmf1umxHlo+ +HgURKZBcjDmBKLpvSSS2WsvjwnHD2hq81ZAtBOfWO0myjWECYuByxqHzV3zo6tLz +6q0wxsECgYA26twPrAoRqvfvPnNj6o0LrsE39Tj6jHIVijT7Lbcf2xVnaDiQ18PQ +RC6Tgkz5KZf8GKfMRMA3WopGn9QE2luI4RLIbhLozEDrkk2L7wSYqI9DZ1Hd26wf +v3+3jdpsXkzHwWYz1a2+FhCF5mJJRQl6kd/B0wu00vdfwviK9OVO7w== +-----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/rsa_private_encrypted.pem b/test/fixtures/keys/rsa_private_encrypted.pem new file mode 100644 index 00000000000000..f1914289ec4f7f --- /dev/null +++ b/test/fixtures/keys/rsa_private_encrypted.pem @@ -0,0 +1,30 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-256-CBC,DB3D20E60E8FDC3356BD79712FF8EF7E + +K+vu0U3IFTJBBi6zW5Zng80O1jXq/ZmlOFs/j/SQpPwfW1Do9i/Dwa7ntBlTwrCm +sd3IIPgu2ikfLwxvbxsZN540oCaCqaZ/bmmyzH3MyVDA9MllUu+X8+Q3ATzcYa9R +U5XfF5DAXsSRnstCbmKagWVQpO0oX8k3ratfny6Ixq86Y82tK8+o5YiBFq1kqa+9 +4yat7IWQbqV5ifUtUPCHZwEqBt+WKazX05BqERjkckHdpfaDrBvSSPXTwoLm6uRR +ktkUVpO4tHMZ4VlcTfFtpz8gdYYod0nM6vz26hvbESHSwztSgMhmKdsE5eqmYfgu +F4WkEN4bqAiPjKK3jnUKPt/vg2oKYFQlVYFl9QnBjiRqcQTi3e9lwn1hI7uoMb6g +HuaCc57JJHPN/ZLP3ts4ZxFbwUjTGioh5Z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b2AzYAHLnp/ehDQGKWrCOJ1JE2vBv8ZkLa+XZo7YASXBRZitPOMlvykEyzxmR +QAmNhKGvFmeM2mmHAp0aC03rgF3lxNsXQ1CyfEdq3UV9ReSnttq8gtrJfCwxV+wY +-----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/rsa_private_pkcs8.pem b/test/fixtures/keys/rsa_private_pkcs8.pem new file mode 100644 index 00000000000000..cd274ae6d9071d --- /dev/null +++ b/test/fixtures/keys/rsa_private_pkcs8.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC33FiIiiexwLe/ +P8DZx5HsqFlmUO7/lvJ7necJVNwqdZ3ax5jpQB0p6uxfqeOvzcN3k5V7UFb/Am+n +kSNZMAZhsWzCU2Z4Pjh50QYz3f0Hour7/yIGStOLyYY3hgLK2K8TbhgjQPhdkw9+ +QtKlpvbL8fLgONAoGrVOFnRQGcr70iFffsm79mgZhKVMgYiHPJqJgGHvCtkGg9zM +gS7p63+Q3ZWedtFS2RhMX3uCBy/mH6EOlRCNBbRmA4xxNzyf5GQaki3T+Iz9tOMj +dPP+CwV2LqEdylmBuik8vrfTb3qIHLKKBAI8lXN26wWtA3kN4L7NP+cbKlCRlqct +vhmylLH1AgMBAAECggEBAJLZ6ti7yDKgY+LcT/NiBDqKyEUBlbMNZIW5vAPnBKbh +JIDO9WIv9Fs7qSpLbnFHnr0OYtGIfMPXtUiYkyw0QJSc+upHZMvbno4llpes0eHc +jWVTBWETON4oywvj/Kz53vRc9eiKhxVuVWyagNcQgYSprjzLA+9UTcWeB67Guyrf +8YJUE2LC23RiMA5nGYoSHfVRl0c75gj7A0X9nwpAI+xw3kcaVHRIhA6WowA3Pj1o +pK2t692+NLVRylpvMMSS4rziDexomFykCFukYWYB/kZOOSSETSsTWoMXXl1KqsoZ +8IW06NR4rXtIgQ3sTfbYKGZNF5nWFgZ+hJVx0We1Qg0CgYEA8UovlB4nrBm7xH+u +7XXBMbqxADQm5vaEZxw9eluc+tP7cIAI4sglMIvL/FMpbd2pEeP/BkR76NTDzzDu +PAZvUGRavgEjy0O9j2NAs/WPK4tZF+vFdunhnSh4EHAF4Ij9kbsUi90NOpbGfVqP +dOaHqzgHKoR23Cuusk9wFQ2XTV8CgYEAwxHdEYT9xrpfrHPqSBQPpO0dWGKJEkrW +Ob+76rSfuL8wGR4OBNmQdhLuU9zTIh22pog+XPnLPAecC+4yu/wtJ2SPCKiKDbJB +re0CKPyRfGqzvA3njXwMxXazU4kGs+2Fg+xu/iKbaIjxXrclBLhkxhBtySrwAFhx +xOk6fFcPLSsCgYEAqS/Mdr5CMRGGMH0bKhPUWEtAixUGZhJaunX5wY71Xoc/Gh4c +nO+b7BNJ/+5L8WZog0vr6PgiLhrqBaCYm2wjpyoG2o2wDHm+NAlzN/wp3G2EFhrS +xdOux+S1c0kpRcyoiAO2n29rNDa+jOzwBBcU8ACEPdLOCQl0IEFFJO33tl8CgYBY +DOIqnEsovsucvh3MNzHwkg8i7CdPGHSmUIN0J9/ItpPxYn2VdtccVOM6+3xZ8+uU +M/9iXGZ+TDkFsZk4/VUsaNmfYOQf1oyLA2ZsNcU90bQbeHNCi/H/19qOJFXgNaCE +sd5P3DMl9lptFGIjRVBHjvbfTQBUR5fi+BusMGfrTQKBgQCTtzMEJP2sef883AJr +XuGVPLzwLi9eTBvPzc5r5pfkvh7mDDmWFxHZm5kctvavqgy32uUPsQgMi1Kz67bU +s5dY9MCVrN2elhTLD8LOiAz8836o3AxFefm5cUWGaU/aZWDYR0QtNqFdyHyRaodo +JJfnfK+oK1Eq7+PvpXfVN9BkYw== +-----END PRIVATE KEY----- diff --git a/test/fixtures/keys/rsa_private_pkcs8_bad.pem b/test/fixtures/keys/rsa_private_pkcs8_bad.pem new file mode 100644 index 00000000000000..ca36972e3a6503 --- /dev/null +++ b/test/fixtures/keys/rsa_private_pkcs8_bad.pem @@ -0,0 +1,28 @@ +-----BE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GqzvA3njXwMxXazU4kGs+2Fg+xu/iKbaIjxXrclBLhkxhBtySrwAFhx +xOk6fFcPLSsCgYEAqS/Mdr5CMRGGMH0bKhPUWEtAixUGZhJaunX5wY71Xoc/Gh4c +nO+b7BNJ/+5L8WZog0vr6PgiLhrqBaCYm2wjpyoG2o2wDHm+NAlzN/wp3G2EFhrS +xdOux+S1c0kpRcyoiAO2n29rNDa+jOzwBBcU8ACEPdLOCQl0IEFFJO33tl8CgYBY +DOIqnEsovsucvh3MNzHwkg8i7CdPGHSmUIN0J9/ItpPxYn2VdtccVOM6+3xZ8+uU +M/9iXGZ+TDkFsZk4/VUsaNmfYOQf1oyLA2ZsNcU90bQbeHNCi/H/19qOJFXgNaCE +sd5P3DMl9lptFGIjRVBHjvbfTQBUR5fi+BusMGfrTQKBgQCTtzMEJP2sef883AJr +XuGVPLzwLi9eTBvPzc5r5pfkvh7mDDmWFxHZm5kctvavqgy32uUPsQgMi1Kz67bU +s5dY9MCVrN2elhTLD8LOiAz8836o3AxFefm5cUWGaU/aZWDYR0QtNqFdyHyRaodo +JJfnfK+oK1Eq7+PvpXfVN9BkYw== +-----END RSA PRIVATE KEY----- diff --git a/test/fixtures/keys/rsa_public.pem b/test/fixtures/keys/rsa_public.pem new file mode 100644 index 00000000000000..8c30cfa52d47af --- /dev/null +++ b/test/fixtures/keys/rsa_public.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt9xYiIonscC3vz/A2ceR +7KhZZlDu/5bye53nCVTcKnWd2seY6UAdKersX6njr83Dd5OVe1BW/wJvp5EjWTAG +YbFswlNmeD44edEGM939B6Lq+/8iBkrTi8mGN4YCytivE24YI0D4XZMPfkLSpab2 +y/Hy4DjQKBq1ThZ0UBnK+9IhX37Ju/ZoGYSlTIGIhzyaiYBh7wrZBoPczIEu6et/ +kN2VnnbRUtkYTF97ggcv5h+hDpUQjQW0ZgOMcTc8n+RkGpIt0/iM/bTjI3Tz/gsF +di6hHcpZgbopPL630296iByyigQCPJVzdusFrQN5DeC+zT/nGypQkZanLb4ZspSx +9QIDAQAB +-----END PUBLIC KEY----- diff --git a/test/fixtures/keys/rsa_public_b.pem b/test/fixtures/keys/rsa_public_b.pem new file mode 100644 index 00000000000000..bce0804617fcb6 --- /dev/null +++ b/test/fixtures/keys/rsa_public_b.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyb1grrN+29fxeeEbTaSE +ja6TKDTpT/WXnqrFCS+h7IYcnDoAVwcsPU5FZeUPvLKMzi9NHSJ34LQCurqHgH8X ++cw0YT3gdYS/7qoQiXs+zKv615NcttD3xlQLceY+NwznoPXyyZwOeZqyU5Hiqbrq +u6hdr6gQYogMNLn2NxBW2pGegd6+ZGMCX3+/BtMP/6tXmttYjY+yhN2SrGz5cKhW +pcHiC6X+B7uCKoKZy+t2jUxYVKUwWr1ZuM8kpSnuVCcv1OoMGEimEHA7v/eaF/y+ +z/VdQ4Y88GhTnVN4KbtgZ+o9PohjxLFU62VeTALixU5mPQKSgSICKfjev0FUUurF +6wIDAQAB +-----END PUBLIC KEY----- diff --git a/test/fixtures/keys/rsa_public_sha1_signature_signedby_rsa_private.sha1 b/test/fixtures/keys/rsa_public_sha1_signature_signedby_rsa_private.sha1 new file mode 100644 index 00000000000000..57435806d9623c --- /dev/null +++ b/test/fixtures/keys/rsa_public_sha1_signature_signedby_rsa_private.sha1 @@ -0,0 +1,2 @@ +yfF4}x=e Z'`a%Z>Ytmxd4Ec(9ȴ kL2+qSi2:[dfj/5П9O<8'. OeL82tӟ/3K,ЊlZڅt[4f#* Y 餡w/2ߗfꢅXhaYtmxd4Ec(9ȴ kL2+qSi2:[dfj/5П9O<8'. OeL82tӟ/3K,ЊlZڅt[4f#* Y 餡w/2ߗfꢅXha { // Test RSA signing and verification // { - const privateKey = fixtures.readSync('test_rsa_privkey_2.pem'); - const publicKey = fixtures.readSync('test_rsa_pubkey_2.pem'); + const privateKey = fixtures.readKey('rsa_private_b.pem'); + const publicKey = fixtures.readKey('rsa_public_b.pem'); const input = 'I AM THE WALRUS'; - const signature = - '79d59d34f56d0e94aa6a3e306882b52ed4191f07521f25f505a078dc2f89' + - '396e0c8ac89e996fde5717f4cb89199d8fec249961fcb07b74cd3d2a4ffa' + - '235417b69618e4bcd76b97e29975b7ce862299410e1b522a328e44ac9bb2' + - '8195e0268da7eda23d9825ac43c724e86ceeee0d0d4465678652ccaf6501' + - '0ddfb299bedeb1ad'; + const signature = fixtures.readKey( + 'I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256', + 'hex' + ); const sign = crypto.createSign('SHA256'); sign.update(input); const output = sign.sign(privateKey, 'hex'); - assert.strictEqual(signature, output); + assert.strictEqual(output, signature); const verify = crypto.createVerify('SHA256'); verify.update(input); @@ -263,7 +260,7 @@ assert.throws(() => { sign2.update(input); const output2 = sign2.sign(privateKey, 'hex'); - assert.strictEqual(signature, output2); + assert.strictEqual(output2, signature); const verify2 = crypto.createVerify('SHA256'); verify2.update(input); diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js index 1952f8908acb03..86c617815f2726 100644 --- a/test/parallel/test-crypto.js +++ b/test/parallel/test-crypto.js @@ -224,17 +224,12 @@ assert.throws(function() { }); assert.throws(function() { - // The correct header inside `test_bad_rsa_privkey.pem` should have been + // The correct header inside `rsa_private_pkcs8_bad.pem` should have been // -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- // instead of // -----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY----- - // It is generated in this way: - // $ openssl genrsa -out mykey.pem 512; - // $ openssl pkcs8 -topk8 -inform PEM -outform PEM -in mykey.pem \ - // -out private_key.pem -nocrypt; - // Then open private_key.pem and change its header and footer. - const sha1_privateKey = fixtures.readSync('test_bad_rsa_privkey.pem', - 'ascii'); + const sha1_privateKey = fixtures.readKey('rsa_private_pkcs8_bad.pem', + 'ascii'); // This would inject errors onto OpenSSL's error stack crypto.createSign('sha1').sign(sha1_privateKey); }, (err) => { From d34a40537473429f9bf60c125d9c1fe0dd34b19d Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Tue, 28 May 2019 14:28:59 -0700 Subject: [PATCH 04/17] test: move dsa keypairs to fixtures/keys/ PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/keys/Makefile | 20 +++++++++++++++++ test/fixtures/keys/dsa_params.pem | 14 ++++++++++++ test/fixtures/keys/dsa_private.pem | 20 +++++++++++++++++ test/fixtures/keys/dsa_private_encrypted.pem | 23 ++++++++++++++++++++ test/fixtures/keys/dsa_private_pkcs8.pem | 15 +++++++++++++ test/fixtures/keys/dsa_public.pem | 20 +++++++++++++++++ test/fixtures/test_dsa_params.pem | 14 ------------ test/fixtures/test_dsa_pkcs8_privkey.pem | 15 ------------- test/fixtures/test_dsa_privkey.pem | 20 ----------------- test/fixtures/test_dsa_privkey_encrypted.pem | 16 -------------- test/fixtures/test_dsa_pubkey.pem | 20 ----------------- test/parallel/test-crypto-binary-default.js | 4 ++-- test/parallel/test-crypto-rsa-dsa.js | 10 ++++----- 13 files changed, 119 insertions(+), 92 deletions(-) create mode 100644 test/fixtures/keys/dsa_params.pem create mode 100644 test/fixtures/keys/dsa_private.pem create mode 100644 test/fixtures/keys/dsa_private_encrypted.pem create mode 100644 test/fixtures/keys/dsa_private_pkcs8.pem create mode 100644 test/fixtures/keys/dsa_public.pem delete mode 100644 test/fixtures/test_dsa_params.pem delete mode 100644 test/fixtures/test_dsa_pkcs8_privkey.pem delete mode 100644 test/fixtures/test_dsa_privkey.pem delete mode 100644 test/fixtures/test_dsa_privkey_encrypted.pem delete mode 100644 test/fixtures/test_dsa_pubkey.pem diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index c51991575edcf7..03a3011056adc6 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -24,6 +24,11 @@ all: \ dh512.pem \ dh1024.pem \ dh2048.pem \ + dsa_params.pem \ + dsa_private.pem \ + dsa_private_encrypted.pem \ + dsa_private_pkcs8.pem \ + dsa_public.pem \ dsa1025.pem \ dsa_private_1025.pem \ dsa_private_encrypted_1025.pem \ @@ -564,6 +569,21 @@ dh1024.pem: dh2048.pem: openssl dhparam -out dh2048.pem 2048 +dsa_params.pem: + openssl dsaparam -out dsa_params.pem 2048 + +dsa_private.pem: dsa_params.pem + openssl gendsa -out dsa_private.pem dsa_params.pem + +dsa_private_encrypted.pem: dsa_private.pem + openssl dsa -aes256 -in dsa_private.pem -passout 'pass:password' -out dsa_private_encrypted.pem + +dsa_private_pkcs8.pem: dsa_private.pem + openssl pkcs8 -topk8 -inform PEM -outform PEM -in dsa_private.pem -out dsa_private_pkcs8.pem -nocrypt + +dsa_public.pem: dsa_private.pem + openssl dsa -in dsa_private.pem -pubout -out dsa_public.pem + dsa1025.pem: openssl dsaparam -out dsa1025.pem 1025 diff --git a/test/fixtures/keys/dsa_params.pem b/test/fixtures/keys/dsa_params.pem new file mode 100644 index 00000000000000..9052393fd2ebbe --- /dev/null +++ b/test/fixtures/keys/dsa_params.pem @@ -0,0 +1,14 @@ +-----BEGIN DSA PARAMETERS----- +MIICLQKCAQEAoSw3Ghf02sMSmd5k2rvSqf6eJPFO7fHDRyvDDbifjO6/BKSIkXM4 +3qyCqddC04arKg7wc1QDEQ8gb13pCmnC0RBiljE6ke4yK46Q5JjiEKH9U1eCbtTr +hcGrLDgwbqvRM06EN6IfAL3OBF6YzS9wn3/EfSwW2Z8gAIkjZrTjEUTV+/gEAdfE +gd/WAZxcc9zYKOwPy0/LjjldQw5fsPlIEkS1yJFlWMokSsZVYlJLR06h1S4kQoE3 +BqELirH/FQfJ36RMRFsaKZ6nQYS66Qc8rybQw2VlOJsqiRoTSDwREPz6j9oLYh1E +e86j5Xt9jbiBrK33UbkTr/jBtO0J2PR0+wIhAIXIexS5LQJPSoi96k6OU4yrLLmA +IY8gS9mdYTdbpwcdAoIBAQCCN3gTjFiPgBQ/bj/Edp9w90SA+dQ/VnnYDTMcz+Mi +/8sgtlQ3O9CCFb0327YnOLwvxsmSadT9XrIq1/5jGD2VtjFDVlridjYASrjezR2k +dr781G+bxtVNQuIOKZl9xqruCmHUSSRL/vuCR6pKsA81ZPfpdcLh3RYYxDIoTK6t +VX4GrX5bcxGDIUCQiTaqKv9Nzpm1liBLRm6LHczBsFk2OVrRyMsT3gh0J6DSUw+d +w/Vru1J6glkrr0CxBWoJ65btcqtFyQV/76btor9Qgc/z9suYBoJZ3Ua0yAfv3J2E +rOs1CAbh4LWNULA9eJObY2R4sAV7Q8wOMT5jmjKo4unp +-----END DSA PARAMETERS----- diff --git a/test/fixtures/keys/dsa_private.pem b/test/fixtures/keys/dsa_private.pem new file mode 100644 index 00000000000000..3f64ae4e85f0d4 --- /dev/null +++ b/test/fixtures/keys/dsa_private.pem @@ -0,0 +1,20 @@ +-----BEGIN DSA PRIVATE KEY----- +MIIDVwIBAAKCAQEAoSw3Ghf02sMSmd5k2rvSqf6eJPFO7fHDRyvDDbifjO6/BKSI +kXM43qyCqddC04arKg7wc1QDEQ8gb13pCmnC0RBiljE6ke4yK46Q5JjiEKH9U1eC +btTrhcGrLDgwbqvRM06EN6IfAL3OBF6YzS9wn3/EfSwW2Z8gAIkjZrTjEUTV+/gE +AdfEgd/WAZxcc9zYKOwPy0/LjjldQw5fsPlIEkS1yJFlWMokSsZVYlJLR06h1S4k +QoE3BqELirH/FQfJ36RMRFsaKZ6nQYS66Qc8rybQw2VlOJsqiRoTSDwREPz6j9oL +Yh1Ee86j5Xt9jbiBrK33UbkTr/jBtO0J2PR0+wIhAIXIexS5LQJPSoi96k6OU4yr +LLmAIY8gS9mdYTdbpwcdAoIBAQCCN3gTjFiPgBQ/bj/Edp9w90SA+dQ/VnnYDTMc +z+Mi/8sgtlQ3O9CCFb0327YnOLwvxsmSadT9XrIq1/5jGD2VtjFDVlridjYASrje +zR2kdr781G+bxtVNQuIOKZl9xqruCmHUSSRL/vuCR6pKsA81ZPfpdcLh3RYYxDIo +TK6tVX4GrX5bcxGDIUCQiTaqKv9Nzpm1liBLRm6LHczBsFk2OVrRyMsT3gh0J6DS +Uw+dw/Vru1J6glkrr0CxBWoJ65btcqtFyQV/76btor9Qgc/z9suYBoJZ3Ua0yAfv +3J2ErOs1CAbh4LWNULA9eJObY2R4sAV7Q8wOMT5jmjKo4unpAoIBAQCE1m+DUb9L +T58u6XV/L1p6K9T2mc6jAmzD51fPiUwsRov9sDGJmSnQjQ5pt3hVp8inVfNkhqOI +1rpdKmx5W00fPu6VCiPuximuHSNHzJpCAVUrIH8YasS+AurCOwGMdvODLF6dx7yR +MdxbiszrBry8J0TdvqElHZ1YmQDwoHH7R4pUd31jsk4gnE6pkqLgWwVAy0LXXGsg +2JfnDvdQY8fIHkuezLdhOyO9pRlXSYv4fLdMaSjHyEcwr2hnm5tm5RsBwM+u0sDc +yBqUjwoN8NTuLLasfJzzmjeHWDcRGFbzKt/xlUkQ7pf+xdelnLOstuPDGglB1U85 +REhx4rQGKg7nAiA0FX4e4Ms3OXUnmtsTALk5YMiMF3jUp4pRDhHFKBgsYQ== +-----END DSA PRIVATE KEY----- diff --git a/test/fixtures/keys/dsa_private_encrypted.pem b/test/fixtures/keys/dsa_private_encrypted.pem new file mode 100644 index 00000000000000..49b3375baf7194 --- /dev/null +++ b/test/fixtures/keys/dsa_private_encrypted.pem @@ -0,0 +1,23 @@ +-----BEGIN DSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-256-CBC,FABA263DD471F214EF3E02699B837C20 + +Tj2+4x9MEIaQGFQ4o7hk12MriVYyvLO5aCbqq7LG5uhVk546/+bJc6hewdSwb6oT +MYPbuV+QTdtqshqFESA0McyGlj4w1tOg5TomP84NTKvwTO1EirVLMukfF3dqaguw +C117AZJkGbqgbi6lZ2bG0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/fixtures/keys/dsa_private_pkcs8.pem new file mode 100644 index 00000000000000..8e4be9e7224fd1 --- /dev/null +++ b/test/fixtures/keys/dsa_private_pkcs8.pem @@ -0,0 +1,15 @@ +-----BEGIN PRIVATE KEY----- +MIICZQIBADCCAjoGByqGSM44BAEwggItAoIBAQChLDcaF/TawxKZ3mTau9Kp/p4k +8U7t8cNHK8MNuJ+M7r8EpIiRczjerIKp10LThqsqDvBzVAMRDyBvXekKacLREGKW +MTqR7jIrjpDkmOIQof1TV4Ju1OuFwassODBuq9EzToQ3oh8Avc4EXpjNL3Cff8R9 +LBbZnyAAiSNmtOMRRNX7+AQB18SB39YBnFxz3Ngo7A/LT8uOOV1DDl+w+UgSRLXI +kWVYyiRKxlViUktHTqHVLiRCgTcGoQuKsf8VB8nfpExEWxopnqdBhLrpBzyvJtDD +ZWU4myqJGhNIPBEQ/PqP2gtiHUR7zqPle32NuIGsrfdRuROv+MG07QnY9HT7AiEA +hch7FLktAk9KiL3qTo5TjKssuYAhjyBL2Z1hN1unBx0CggEBAII3eBOMWI+AFD9u +P8R2n3D3RID51D9WedgNMxzP4yL/yyC2VDc70IIVvTfbtic4vC/GyZJp1P1esirX +/mMYPZW2MUNWWuJ2NgBKuN7NHaR2vvzUb5vG1U1C4g4pmX3Gqu4KYdRJJEv++4JH +qkqwDzVk9+l1wuHdFhjEMihMrq1VfgatfltzEYMhQJCJNqoq/03OmbWWIEtGbosd +zMGwWTY5WtHIyxPeCHQnoNJTD53D9Wu7UnqCWSuvQLEFagnrlu1yq0XJBX/vpu2i +v1CBz/P2y5gGglndRrTIB+/cnYSs6zUIBuHgtY1QsD14k5tjZHiwBXtDzA4xPmOa +Mqji6ekEIgIgNBV+HuDLNzl1J5rbEwC5OWDIjBd41KeKUQ4RxSgYLGE= +-----END PRIVATE KEY----- diff --git a/test/fixtures/keys/dsa_public.pem b/test/fixtures/keys/dsa_public.pem new file mode 100644 index 00000000000000..7d2f2c63bc8e0e --- /dev/null +++ b/test/fixtures/ke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0mL+Hy3TGko +x8hHMK9oZ5ubZuUbAcDPrtLA3MgalI8KDfDU7iy2rHyc85o3h1g3ERhW8yrf8ZVJ +EO6X/sXXpZyzrLbjwxoJQdVPOURIceK0BioO5w== +-----END PUBLIC KEY----- diff --git a/test/fixtures/test_dsa_params.pem b/test/fixtures/test_dsa_params.pem deleted file mode 100644 index 70073722687ed2..00000000000000 --- a/test/fixtures/test_dsa_params.pem +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN DSA PARAMETERS----- -MIICIAKCAQEAiJCR40HCtA6pk864XhKceke8N4chlrpwcphAXpHwSQGHlv1JJFyj -aPqugWtzwZH55g7qpIiT3fmg6V6PfzNfx4sQGlSjckZaN02WRUAacn0va6UbwyYV -7LZzuHlHzayHLl/btGeTF+zL+9eMLKfll+r+5bJXDMWh3xUD1Nldf+fsIsbVZI9Q -Nzf3L1/07XVTLedQYaE77OqVuu+cfoBtb+K5MsQdHMMN20BGjKIvGkJICuC448Gk -Dx1wpxz2vSJEi6FqXruM6c9yrPvhJKSfbVFYK2n82MMXMNNu9Dwqwsv6Ig6dIVyw -dKDrSw1Nz9j9TWA5BolNta3yMPHrEjCuIQIVAKq0ZZ0/36sZE1cqt6j0hZTisWUV -AoIBAFbI9MKn9DBJ7lo7+LRblgNKg9lk4D/6NBBRgOeCN4WnOxHQrqpSTUBG+VcA -BDKEfoHfEPI9KZKpEgpzGTpr7mGxDPLHfGL+vvf1EYbmcTDrUWlf9B/3+L3uwIdd -v3NYLepyEZ8L8g6eRGSQ4Svg1oSR/GAUTeGJczPg6qW0b/LTpf4eeDNWYGF6aogJ -UphnPcZ0Xqw+yvq/i1uzAVirUxp9Crb7km0dfA0G/HBiSdcEt6l8LdQd6qmcL0nx -cm9x6L+tSol5hXNynV0wcxdCQz4Xj5na+NoRGb9jPYxgLkoq07hwAkqkQDyF61tx -fWgGc7zmh/x6JMGe/Xhg1TvgxLs= ------END DSA PARAMETERS----- diff --git a/test/fixtures/test_dsa_pkcs8_privkey.pem b/test/fixtures/test_dsa_pkcs8_privkey.pem deleted file mode 100644 index 3d15aa1162a97d..00000000000000 --- a/test/fixtures/test_dsa_pkcs8_privkey.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIICZAIBADCCAjkGByqGSM44BAEwggIsAoIBAQC5CYW1vZHbx/Ytm+/m+oseHbre -kOd40VOSybqo6Us2NysFq+46rNlnR28Lkolg4nv+XK6YTlB3XbEwbibYa1uwCuAE -io/Zs2rfOpGNwp31Fg3pb8ZhFrnjmhrQhZfRT6bXXw3hvyXitjgQkwIsRL5OUYlQ -CEIbf+LsogikQez2+xaYYkqUqSYdb48IkVtDTMweWslpDKUmIfH1cy0osqMC97GR -8EXXvhK7sig2hhHtj+NFGA7majfEFmTd0mafZBlEFodqvkwV1q7TTMrDWgkO2lcc -2DEMjZ9on9xVszRhNCGIwuFJLhWBKfNZ59X7LUxEfkelpce0Kr5eFmxwN4n3AiEA -pK7pu7TqHqiIoGDmAyUm71gx3V5T3mNaih8Y/9h7dMsCggEAJNtfC6LqpU84UMz+ -nsxSch/ylDx1lyh3rOGZ9Wn+2tIhahI+hqDwmPeHvymzDHh2QjuXgzeZmo1753CB -CtYdU0GnumSEEUUCiTBbSsX6Zy0VI4w/Qy3WV5IoXXkF9YsbkC8JhPq9jHLa5Qt5 -59TF+347OFso5ae+XkkZ8C112UyKnYzvniqlbj0Cb4E7FadCzSggC9c2drYE12Mx -QEEbddAVNty5wpjh3Qd2y8kKPDSn4OCrSIXAL8WDXJk507RL5moqKnwis/3iPUXi -U7s8QmJP4B8Mn4vDM1O0rORCmz9KXz0f5M0lw39jdA/AG0fNNz86KCFTPdXz/Iz1 -ThphTQQiAiAhjvXffKp1V3nMiUUUsYzS2Msn14bBFiBwSdNgitRwEA== ------END PRIVATE KEY----- diff --git a/test/fixtures/test_dsa_privkey.pem b/test/fixtures/test_dsa_privkey.pem deleted file mode 100644 index 2056740af99718..00000000000000 --- a/test/fixtures/test_dsa_privk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TLManftSifh5DJpglaL -yQ/2+uGje419/kOWOexZ8ysREKIBrhWhePolw8SAiygwbCUhgSbruWpJPpQOOtI5 -YTh2lIK0vAIgIY7133yqdVd5zIlFFLGM0tjLJ9eGwRYgcEnTYIrUcBA= ------END DSA PRIVATE KEY----- diff --git a/test/fixtures/test_dsa_privkey_encrypted.pem b/test/fixtures/test_dsa_privkey_encrypted.pem deleted file mode 100644 index 11bc8fbdeee1c8..00000000000000 --- a/test/fixtures/test_dsa_privkey_encrypted.pem +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIICkjAcBgoqhkiG9w0BDAEDMA4ECLCAnNHA9e3tAgIIAASCAnC9H9ncbLh/TpT9 -jVecNZZ+udUB0qmaqIQ+qW03NJfrJdGhAd8tbhGb2hqIi4tLfOpUAQS93BfMXguM -hyVQWJLGreIm7ehIqXwwFJFts9WJWsS9UleHOTtKNQvft3Lkp29lR/DZtXsJfJbT -0gjjHFpGhaNnIEK8eRAoyXZTPLv6ZPvFp4szj7GjslP5dvkcBeXbgTlBAT4EVB9e -43tfF1J2wOnuIkQXvnZ5eVseYIbKpCjAU/ZkoZU6ySVvFkc3+NIB9qHqKsE4LKdp -wqhCuuh0b95TpiUoI+IIsLUbcGW7EZGwkVV2NxYZGpNehx5/kwGnH32KyDOqNVkm -y5sC96oRSXz9eAo69zC0LgFL4ZyHWa9gebgPXRSbegiLNt+wxE4arSPlwUaKWzlH -qEL2zzeVBIvuDwQ6SDMNiNv1GK68kaZ9AuR0jPn3COO2TgdWaigqrGPpNv8c/F2m -Hv1ex6FAJr88aglxU7K6gS7ayFtWZqdg4K7KIGrP8Ii/UCkzQxSnFRTFbjUJCK8A -5mM7/jpmUd/U6Ygl/QrtMjPBHN02CjTc3LZK92uUf0g1u838zX91FxvItzyockpg -rkZ5UWggZ2q0Hg7duYffjOR28d6u44JPIPJ9WIN2upsZoP1ABdUdazBRhpq9Da68 -7+lpZC5BGwhpiP93bB66T+QwjqLCDFygIaCii+vQq/814pk/i/7VBEVGm2iDjOx/ -Ng99ltKl+JDJ/lQwE27pp+JP+9Oe8uU94kelPA7w8xrj/YuukQbVY03+WYFag/Dn -uMJyKYOqm7LmHOQy8rggM9RjY6XQY0KV8BKX3wG+4zjARTLKRbo= ------END ENCRYPTED PRIVATE KEY----- diff --git a/test/fixtures/test_dsa_pubkey.pem b/test/fixtures/test_dsa_pubkey.pem deleted file mode 100644 index 54d01bef7ae72c..00000000000000 --- a/test/fixtures/test_dsa_pubkey.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIDRjCCAjkGByqGSM44BAEwggIsAoIBAQC5CYW1vZHbx/Ytm+/m+oseHbrekOd4 -0VOSybqo6Us2NysFq+46rNlnR28Lkolg4nv+XK6YTlB3XbEwbibYa1uwCuAEio/Z -s2rfOpGNwp31Fg3pb8ZhFrnjmhrQhZfRT6bXXw3hvyXitjgQkwIsRL5OUYlQCEIb -f+LsogikQez2+xaYYkqUqSYdb48IkVtDTMweWslpDKUmIfH1cy0osqMC97GR8EXX -vhK7sig2hhHtj+NFGA7majfEFmTd0mafZBlEFodqvkwV1q7TTMrDWgkO2lcc2DEM -jZ9on9xVszRhNCGIwuFJLhWBKfNZ59X7LUxEfkelpce0Kr5eFmxwN4n3AiEApK7p -u7TqHqiIoGDmAyUm71gx3V5T3mNaih8Y/9h7dMsCggEAJNtfC6LqpU84UMz+nsxS -ch/ylDx1lyh3rOGZ9Wn+2tIhahI+hqDwmPeHvymzDHh2QjuXgzeZmo1753CBCtYd -U0GnumSEEUUCiTBbSsX6Zy0VI4w/Qy3WV5IoXXkF9YsbkC8JhPq9jHLa5Qt559TF -+347OFso5ae+XkkZ8C112UyKnYzvniqlbj0Cb4E7FadCzSggC9c2drYE12MxQEEb -ddAVNty5wpjh3Qd2y8kKPDSn4OCrSIXAL8WDXJk507RL5moqKnwis/3iPUXiU7s8 -QmJP4B8Mn4vDM1O0rORCmz9KXz0f5M0lw39jdA/AG0fNNz86KCFTPdXz/Iz1Thph -TQOCAQUAAoIBAEvFO/T+HGsdvBJofJEKoixMqKPPSyLA/g4gbhKXkhm+7ctvXT9n -kSAXHuAFR0Ow/z8JJvG8Z4efmIg6g9d9+OJWWN9muczF5jJzdXv5T7Ntaf8+1zv+ -YIA88PoexEBzyABfOyrzxYjteFYtZvSMxvzZruBZZLPuCAV5bF8YCw22I7bkLjoZ -lPlbSMYkG623vsFTIc82gzTLf8F6+bcAMFmz6icpz5aHZ3RJRE8+nTSy9IFutbhz -fwhbGjEyzGp37Uon4eQyaYJWi8kP9vrho3uNff5DljnsWfMrERCiAa4VoXj6JcPE -gIsoMGwlIYEm67lqST6UDjrSOWE4dpSCtLw= ------END PUBLIC KEY----- diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index e4c66969f942ff..712a9c7e39977f 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -667,8 +667,8 @@ common.expectsError( // Test DSA signing and verification // { - const privateKey = fixtures.readSync('test_dsa_privkey.pem'); - const publicKey = fixtures.readSync('test_dsa_pubkey.pem'); + const privateKey = fixtures.readKey('dsa_private.pem'); + const publicKey = fixtures.readKey('dsa_public.pem'); const input = 'I AM THE WALRUS'; diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js index 27aef688535c12..1e657b9e60d494 100644 --- a/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js @@ -18,12 +18,12 @@ const rsaPubPem = fixtures.readKey('rsa_public.pem', 'ascii'); const rsaKeyPem = fixtures.readKey('rsa_private.pem', 'ascii'); const rsaKeyPemEncrypted = fixtures.readKey('rsa_private_encrypted.pem', 'ascii'); -const dsaPubPem = fixtures.readSync('test_dsa_pubkey.pem', 'ascii'); -const dsaKeyPem = fixtures.readSync('test_dsa_privkey.pem', 'ascii'); -const dsaKeyPemEncrypted = fixtures.readSync('test_dsa_privkey_encrypted.pem', - 'ascii'); +const dsaPubPem = fixtures.readKey('dsa_public.pem', 'ascii'); +const dsaKeyPem = fixtures.readKey('dsa_private.pem', 'ascii'); +const dsaKeyPemEncrypted = fixtures.readKey('dsa_private_encrypted.pem', + 'ascii'); const rsaPkcs8KeyPem = fixtures.readKey('rsa_private_pkcs8.pem'); -const dsaPkcs8KeyPem = fixtures.readSync('test_dsa_pkcs8_privkey.pem'); +const dsaPkcs8KeyPem = fixtures.readKey('dsa_private_pkcs8.pem'); const decryptError = { message: 'error:06065064:digital envelope routines:EVP_DecryptFinal_ex:' + From 941a1c597311eeb09e0729244f1e5518e9faf434 Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Tue, 28 May 2019 14:40:58 -0700 Subject: [PATCH 05/17] test: move ed448 keypairs to fixtures/keys/ PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/keys/Makefile | 8 ++++++++ test/fixtures/keys/ed448_private.pem | 4 ++++ test/fixtures/keys/ed448_public.pem | 4 ++++ test/fixtures/test_ed448_privkey.pem | 4 ---- test/fixtures/test_ed448_pubkey.pem | 4 ---- test/parallel/test-crypto-key-objects.js | 4 ++-- test/parallel/test-crypto-sign-verify.js | 4 ++-- 7 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 test/fixtures/keys/ed448_private.pem create mode 100644 test/fixtures/keys/ed448_public.pem delete mode 100644 test/fixtures/test_ed448_privkey.pem delete mode 100644 test/fixtures/test_ed448_pubkey.pem diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index 03a3011056adc6..f12664908f6f19 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -62,6 +62,8 @@ all: \ ed25519_public.pem \ x25519_private.pem \ x25519_public.pem \ + ed448_private.pem \ + ed448_public.pem \ # # Create Certificate Authority: ca1 @@ -674,6 +676,12 @@ x25519_private.pem: x25519_public.pem: x25519_private.pem openssl pkey -in x25519_private.pem -pubout -out x25519_public.pem +ed448_private.pem: + openssl genpkey -algorithm ed448 -out ed448_private.pem + +ed448_public.pem: ed448_private.pem + openssl pkey -in ed448_private.pem -pubout -out ed448_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/ed448_private.pem b/test/fixtures/keys/ed448_private.pem new file mode 100644 index 00000000000000..9643665d67656d --- /dev/null +++ b/test/fixtures/keys/ed448_private.pem @@ -0,0 +1,4 @@ +-----BEGIN PRIVATE KEY----- +MEcCAQAwBQYDK2VxBDsEOdOtCnu9bDdBqSHNNZ5xoDA5KdLBTUNPcKFaOADNX32s +dfpo52pCtPqfku/l3/OfUHsF43EfZsaaWA== +-----END PRIVATE KEY----- diff --git a/test/fixtures/keys/ed448_public.pem b/test/fixtures/keys/ed448_public.pem new file mode 100644 index 00000000000000..b767109b187ee2 --- /dev/null +++ b/test/fixtures/keys/ed448_public.pem @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MEMwBQYDK2VxAzoAoX/ee5+jlcU53+BbGRsGIzly0V+SZtJ/oGXY0udf84q2hTW2 +RdstLktvwpkVJOoNb7oDgc2V5ZUA +-----END PUBLIC KEY----- diff --git a/test/fixtures/test_ed448_privkey.pem b/test/fixtures/test_ed448_privkey.pem deleted file mode 100644 index b430a7ee7ca56b..00000000000000 --- a/test/fixtures/test_ed448_privkey.pem +++ /dev/null @@ -1,4 +0,0 @@ ------BEGIN PRIVATE KEY----- -MEcCAQAwBQYDK2VxBDsEObxytD95dGN3Hxk7kVk+Lig1rGYTRr3YdaHjRog++Sgk -QD7KwKmxroBURtkE2N0JbQ3ctdrpGRB5DQ== ------END PRIVATE KEY----- diff --git a/test/fixtures/test_ed448_pubkey.pem b/test/fixtures/test_ed448_pubkey.pem deleted file mode 100644 index 5619b93aeb0310..00000000000000 --- a/test/fixtures/test_ed448_pubkey.pem +++ /dev/null @@ -1,4 +0,0 @@ ------BEGIN PUBLIC KEY----- -MEMwBQYDK2VxAzoAIESY3jnpGdB5UVJDCznrv0vmBFIzgSMu+gafsbCX1rFtsJwR -M6XUDQiEY7dk6rmm/Fktyawna5EA ------END PUBLIC KEY----- diff --git a/test/parallel/test-crypto-key-objects.js b/test/parallel/test-crypto-key-objects.js index 591d3904563960..12c3ba4ff1ef94 100644 --- a/test/parallel/test-crypto-key-objects.js +++ b/test/parallel/test-crypto-key-objects.js @@ -206,8 +206,8 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', { private: fixtures.readKey('ed25519_private.pem', 'ascii'), public: fixtures.readKey('ed25519_public.pem', 'ascii'), keyType: 'ed25519' }, - { private: fixtures.readSync('test_ed448_privkey.pem', 'ascii'), - public: fixtures.readSync('test_ed448_pubkey.pem', 'ascii'), + { private: fixtures.readKey('ed448_private.pem', 'ascii'), + public: fixtures.readKey('ed448_public.pem', 'ascii'), keyType: 'ed448' }, { private: fixtures.readKey('x25519_private.pem', 'ascii'), public: fixtures.readKey('x25519_public.pem', 'ascii'), diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js index 2da2a91655cfdd..0c7f4fb0bc9e37 100644 --- a/test/parallel/test-crypto-sign-verify.js +++ b/test/parallel/test-crypto-sign-verify.js @@ -422,8 +422,8 @@ common.expectsError( public: fixtures.readKey('ed25519_public.pem', 'ascii'), algo: null, sigLen: 64 }, - { private: fixtures.readSync('test_ed448_privkey.pem', 'ascii'), - public: fixtures.readSync('test_ed448_pubkey.pem', 'ascii'), + { private: fixtures.readKey('ed448_private.pem', 'ascii'), + public: fixtures.readKey('ed448_public.pem', 'ascii'), algo: null, sigLen: 114 }, { private: fixtures.readKey('rsa_private_2048.pem', 'ascii'), From e6a110a890812adf789125daf39b8727bef3d96b Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Tue, 28 May 2019 16:39:49 -0700 Subject: [PATCH 06/17] test: move x448 keypairs to fixtures/keys/ PR-URL: #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; From f5fd6c0735c675c51c631fa93ad6faa7afc58722 Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Wed, 29 May 2019 10:16:07 -0700 Subject: [PATCH 07/17] test: move spkac certs to fixtures/keys/ PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/keys/Makefile | 10 ++++++++++ test/fixtures/keys/rsa_spkac.spkac | 1 + test/fixtures/keys/rsa_spkac_invalid.spkac | 1 + test/fixtures/spkac.fail | 1 - test/fixtures/spkac.pem | 6 ------ test/fixtures/spkac.valid | 1 - test/parallel/test-crypto-certificate.js | 11 ++++++----- 7 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 test/fixtures/keys/rsa_spkac.spkac create mode 100644 test/fixtures/keys/rsa_spkac_invalid.spkac delete mode 100644 test/fixtures/spkac.fail delete mode 100644 test/fixtures/spkac.pem delete mode 100644 test/fixtures/spkac.valid diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index 8ca9e4d26c17f6..fd7ca677f63266 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -46,6 +46,8 @@ all: \ rsa_private_b.pem \ I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256 \ rsa_public_b.pem \ + rsa_spkac.spkac \ + rsa_spkac_invalid.spkac \ rsa_private_1024.pem \ rsa_private_2048.pem \ rsa_private_4096.pem \ @@ -630,6 +632,14 @@ I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256: rsa_private_b.pe rsa_public_b.pem: rsa_private_b.pem openssl rsa -in rsa_private_b.pem -pubout -out rsa_public_b.pem +# openssl outputs `SPKAC=[SPKAC]`. That prefix needs to be removed to work with node +rsa_spkac.spkac: rsa_private.pem + openssl spkac -key rsa_private.pem -challenge this-is-a-challenge | cut -c 7- > rsa_spkac.spkac + +# cutting characters from the start to invalidate the spkac +rsa_spkac_invalid.spkac: rsa_spkac.spkac + cat rsa_spkac.spkac | cut -c 5- > rsa_spkac_invalid.spkac + rsa_private_1024.pem: openssl genrsa -out rsa_private_1024.pem 1024 diff --git a/test/fixtures/keys/rsa_spkac.spkac b/test/fixtures/keys/rsa_spkac.spkac new file mode 100644 index 00000000000000..35627672968172 --- /dev/null +++ b/test/fixtures/keys/rsa_spkac.spkac @@ -0,0 +1 @@ +MIICUzCCATswggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC33FiIiiexwLe/P8DZx5HsqFlmUO7/lvJ7necJVNwqdZ3ax5jpQB0p6uxfqeOvzcN3k5V7UFb/Am+nkSNZMAZhsWzCU2Z4Pjh50QYz3f0Hour7/yIGStOLyYY3hgLK2K8TbhgjQPhdkw9+QtKlpvbL8fLgONAoGrVOFnRQGcr70iFffsm79mgZhKVMgYiHPJqJgGHvCtkGg9zMgS7p63+Q3ZWedtFS2RhMX3uCBy/mH6EOlRCNBbRmA4xxNzyf5GQaki3T+Iz9tOMjdPP+CwV2LqEdylmBuik8vrfTb3qIHLKKBAI8lXN26wWtA3kN4L7NP+cbKlCRlqctvhmylLH1AgMBAAEWE3RoaXMtaXMtYS1jaGFsbGVuZ2UwDQYJKoZIhvcNAQEEBQADggEBAIozmeW1kfDfAVwRQKileZGLRGCD7AjdHLYEe16xTBPve8Af1bDOyuWsAm4qQLYA4FAFROiKeGqxCtIErEvm87/09tCfF1My/1Uj+INjAk39DK9J9alLlTsrwSgd1lb3YlXY7TyitCmh7iXLo4pVhA2chNA3njiMq3CUpSvGbpzrESL2dv97lv590gUD988wkTDVyYsf0T8+X0Kww3AgPWGji+2f2i5/jTfD/s1lK1nqi7ZxFm0pGZoy1MJ51SCEy7Y82ajroI+5786nC02mo9ak7samca4YDZOoxN4d3tax4B/HDF5dqJSm1/31xYLDTfujCM5FkSjRc4m6hnriEkc= diff --git a/test/fixtures/keys/rsa_spkac_invalid.spkac b/test/fixtures/keys/rsa_spkac_invalid.spkac new file mode 100644 index 00000000000000..0460a32b810216 --- /dev/null +++ b/test/fixtures/keys/rsa_spkac_invalid.spkac @@ -0,0 +1 @@ +UzCCATswggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC33FiIiiexwLe/P8DZx5HsqFlmUO7/lvJ7necJVNwqdZ3ax5jpQB0p6uxfqeOvzcN3k5V7UFb/Am+nkSNZMAZhsWzCU2Z4Pjh50QYz3f0Hour7/yIGStOLyYY3hgLK2K8TbhgjQPhdkw9+QtKlpvbL8fLgONAoGrVOFnRQGcr70iFffsm79mgZhKVMgYiHPJqJgGHvCtkGg9zMgS7p63+Q3ZWedtFS2RhMX3uCBy/mH6EOlRCNBbRmA4xxNzyf5GQaki3T+Iz9tOMjdPP+CwV2LqEdylmBuik8vrfTb3qIHLKKBAI8lXN26wWtA3kN4L7NP+cbKlCRlqctvhmylLH1AgMBAAEWE3RoaXMtaXMtYS1jaGFsbGVuZ2UwDQYJKoZIhvcNAQEEBQADggEBAIozmeW1kfDfAVwRQKileZGLRGCD7AjdHLYEe16xTBPve8Af1bDOyuWsAm4qQLYA4FAFROiKeGqxCtIErEvm87/09tCfF1My/1Uj+INjAk39DK9J9alLlTsrwSgd1lb3YlXY7TyitCmh7iXLo4pVhA2chNA3njiMq3CUpSvGbpzrESL2dv97lv590gUD988wkTDVyYsf0T8+X0Kww3AgPWGji+2f2i5/jTfD/s1lK1nqi7ZxFm0pGZoy1MJ51SCEy7Y82ajroI+5786nC02mo9ak7samca4YDZOoxN4d3tax4B/HDF5dqJSm1/31xYLDTfujCM5FkSjRc4m6hnriEkc= diff --git a/test/fixtures/spkac.fail b/test/fixtures/spkac.fail deleted file mode 100644 index 4dc12f88bfed12..00000000000000 --- a/test/fixtures/spkac.fail +++ /dev/null @@ -1 +0,0 @@ -MIIB/FAILDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA3L0IfUijj7+A8CPC8EmhcdNoe5fUAog7OrBdhn7EkxFButUp40P7+LiYiygYG1TmoI/a5EgsLU3s9twEz3hmgY9mYIqb/rb+SF8qlD/K6KVyUORC7Wlz1Df4L8O3DuRGzx6/+3jIW6cPBpfgH1sVuYS1vDBsP/gMMIxwTsKJ4P0CAwEAARYkZmI5YWI4MTQtNjY3Ny00MmE0LWE2MGMtZjkwNWQxYTY5MjRkMA0GCSqGSIb3DQEBBQUAA4GBADu1U9t3eY9O3WOofp1RHX2rkh0TPs1CeS+sNdWUSDmdV5ifaGdeXpDikEnh4QIUIeZehxwgy2EjiZqMjMJHF++KPTzfAnHuuEtpDmIGzBnodZa1qt322iGZwgREvacv78GxJBJvPP3KLe+EDDsERG1aWLJoSZRusadacdzNmdV4 diff --git a/test/fixtures/spkac.pem b/test/fixtures/spkac.pem deleted file mode 100644 index 4ad1cdd0bf0d3c..00000000000000 --- a/test/fixtures/spkac.pem +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDcvQh9SKOPv4DwI8LwSaFx02h7 -l9QCiDs6sF2GfsSTEUG61SnjQ/v4uJiLKBgbVOagj9rkSCwtTez23ATPeGaBj2Zg -ipv+tv5IXyqUP8ropXJQ5ELtaXPUN/gvw7cO5EbPHr/7eMhbpw8Gl+AfWxW5hLW8 -MGw/+AwwjHBOwong/QIDAQAB ------END PUBLIC KEY----- diff --git a/test/fixtures/spkac.valid b/test/fixtures/spkac.valid deleted file mode 100644 index 6bfe5bb90d5e58..00000000000000 --- a/test/fixtures/spkac.valid +++ /dev/null @@ -1 +0,0 @@ -MIIBXjCByDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA3L0IfUijj7+A8CPC8EmhcdNoe5fUAog7OrBdhn7EkxFButUp40P7+LiYiygYG1TmoI/a5EgsLU3s9twEz3hmgY9mYIqb/rb+SF8qlD/K6KVyUORC7Wlz1Df4L8O3DuRGzx6/+3jIW6cPBpfgH1sVuYS1vDBsP/gMMIxwTsKJ4P0CAwEAARYkZmI5YWI4MTQtNjY3Ny00MmE0LWE2MGMtZjkwNWQxYTY5MjRkMA0GCSqGSIb3DQEBBQUAA4GBADu1U9t3eY9O3WOofp1RHX2rkh0TPs1CeS+sNdWUSDmdV5ifaGdeXpDikEnh4QIUIeZehxwgy2EjiZqMjMJHF++KPTzfAnHuuEtpDmIGzBnodZa1qt322iGZwgREvacv78GxJBJvPP3KLe+EDDsERG1aWLJoSZRusadacdzNmdV4 diff --git a/test/parallel/test-crypto-certificate.js b/test/parallel/test-crypto-certificate.js index a426e0be003da0..e987be212958a7 100644 --- a/test/parallel/test-crypto-certificate.js +++ b/test/parallel/test-crypto-certificate.js @@ -30,9 +30,10 @@ const { Certificate } = crypto; const fixtures = require('../common/fixtures'); // Test Certificates -const spkacValid = fixtures.readSync('spkac.valid'); -const spkacFail = fixtures.readSync('spkac.fail'); -const spkacPem = fixtures.readSync('spkac.pem'); +const spkacValid = fixtures.readKey('rsa_spkac.spkac'); +const spkacChallenge = 'this-is-a-challenge'; +const spkacFail = fixtures.readKey('rsa_spkac_invalid.spkac'); +const spkacPublicPem = fixtures.readKey('rsa_public.pem'); function checkMethods(certificate) { @@ -41,13 +42,13 @@ function checkMethods(certificate) { assert.strictEqual( stripLineEndings(certificate.exportPublicKey(spkacValid).toString('utf8')), - stripLineEndings(spkacPem.toString('utf8')) + stripLineEndings(spkacPublicPem.toString('utf8')) ); assert.strictEqual(certificate.exportPublicKey(spkacFail), ''); assert.strictEqual( certificate.exportChallenge(spkacValid).toString('utf8'), - 'fb9ab814-6677-42a4-a60c-f905d1a6924d' + spkacChallenge ); assert.strictEqual(certificate.exportChallenge(spkacFail), ''); } From d6ea3fd95b4ae4187f17e90f5d17a8aab73b27a5 Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Wed, 29 May 2019 11:43:44 -0700 Subject: [PATCH 08/17] test: move test_[key|ca|cert] to fixtures/keys/ Lots of changes, but mostly just search/replace of fixtures.readSync(...) to fixtures.readKey([new key]...) Benchmarks modified to use fixtures.readKey(...): benchmark/tls/throughput.js benchmark/tls/tls-connect.js benchmark/tls/secure-pair.js Also be sure to review the change to L16 of test/parallel/test-crypto-sign-verify.js PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- benchmark/tls/secure-pair.js | 10 +++----- benchmark/tls/throughput.js | 10 +++----- benchmark/tls/tls-connect.js | 10 +++----- test/async-hooks/test-graph.tls-write.js | 4 +-- test/async-hooks/test-tlswrap.js | 4 +-- test/fixtures/keys/Makefile | 12 +++++++++ test/fixtures/keys/rsa_ca.crt | 24 ++++++++++++++++++ test/fixtures/keys/rsa_cert.cnf | 23 +++++++++++++++++ test/fixtures/keys/rsa_cert.crt | 24 ++++++++++++++++++ test/fixtures/keys/rsa_cert.pfx | Bin 0 -> 2629 bytes test/fixtures/test_ca.pem | 20 --------------- test/fixtures/test_cert.pem | 20 --------------- test/fixtures/test_cert.pfx | Bin 1885 -> 0 bytes test/fixtures/test_key.pem | 15 ----------- test/parallel/test-crypto-binary-default.js | 6 ++--- test/parallel/test-crypto-rsa-dsa.js | 4 +-- test/parallel/test-crypto-sign-verify.js | 8 +++--- test/parallel/test-crypto-verify-failure.js | 2 +- test/parallel/test-crypto.js | 2 +- test/parallel/test-https-client-reject.js | 6 ++--- .../test-https-client-renegotiation-limit.js | 4 +-- test/parallel/test-https-drain.js | 4 +-- test/parallel/test-https-pfx.js | 2 +- .../test-https-unix-socket-self-signed.js | 4 +-- .../test-tls-async-cb-after-socket-end.js | 4 +-- test/parallel/test-tls-client-abort.js | 4 +-- test/parallel/test-tls-client-reject.js | 6 ++--- .../test-tls-client-renegotiation-limit.js | 4 +-- .../parallel/test-tls-connect-given-socket.js | 4 +-- test/parallel/test-tls-connect-memleak.js | 4 +-- test/parallel/test-tls-connect-no-host.js | 4 +-- .../test-tls-connect-stream-writes.js | 6 ++--- test/parallel/test-tls-destroy-stream.js | 6 ++--- test/parallel/test-tls-fast-writing.js | 6 ++--- test/parallel/test-tls-handshake-exception.js | 4 +-- .../parallel/test-tls-hello-parser-failure.js | 4 +-- test/parallel/test-tls-inception.js | 4 +-- test/parallel/test-tls-interleave.js | 6 ++--- .../test-tls-net-connect-prefer-path.js | 4 +-- test/parallel/test-tls-no-sslv3.js | 4 +-- test/parallel/test-tls-pause.js | 4 +-- test/parallel/test-tls-securepair-fiftharg.js | 4 +-- test/parallel/test-tls-zero-clear-in.js | 4 +-- test/pummel/test-https-no-reader.js | 4 +-- test/sequential/test-async-wrap-getasyncid.js | 6 ++--- test/sequential/test-tls-connect.js | 8 +++--- 46 files changed, 172 insertions(+), 150 deletions(-) create mode 100644 test/fixtures/keys/rsa_ca.crt create mode 100644 test/fixtures/keys/rsa_cert.cnf create mode 100644 test/fixtures/keys/rsa_cert.crt create mode 100644 test/fixtures/keys/rsa_cert.pfx delete mode 100644 test/fixtures/test_ca.pem delete mode 100644 test/fixtures/test_cert.pem delete mode 100644 test/fixtures/test_cert.pfx delete mode 100644 test/fixtures/test_key.pem diff --git a/benchmark/tls/secure-pair.js b/benchmark/tls/secure-pair.js index ed678b9060983e..c0409febacda00 100644 --- a/benchmark/tls/secure-pair.js +++ b/benchmark/tls/secure-pair.js @@ -6,21 +6,19 @@ const bench = common.createBenchmark(main, { size: [2, 1024, 1024 * 1024] }); -const fs = require('fs'); +const fixtures = require('../../test/common/fixtures'); const tls = require('tls'); const net = require('net'); -const path = require('path'); -const cert_dir = path.resolve(__dirname, '../../test/fixtures'); const REDIRECT_PORT = 28347; function main({ dur, size, securing }) { const chunk = Buffer.alloc(size, 'b'); const options = { - key: fs.readFileSync(`${cert_dir}/test_key.pem`), - cert: fs.readFileSync(`${cert_dir}/test_cert.pem`), - ca: [ fs.readFileSync(`${cert_dir}/test_ca.pem`) ], + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: fixtures.readKey('rsa_ca.crt'), ciphers: 'AES256-GCM-SHA384', isServer: true, requestCert: true, diff --git a/benchmark/tls/throughput.js b/benchmark/tls/throughput.js index cd957ff1edf495..a8f2d19649d04a 100644 --- a/benchmark/tls/throughput.js +++ b/benchmark/tls/throughput.js @@ -6,9 +6,7 @@ const bench = common.createBenchmark(main, { size: [2, 1024, 1024 * 1024] }); -const path = require('path'); -const fs = require('fs'); -const cert_dir = path.resolve(__dirname, '../../test/fixtures'); +const fixtures = require('../../test/common/fixtures'); var options; const tls = require('tls'); @@ -32,9 +30,9 @@ function main({ dur, type, size }) { } options = { - key: fs.readFileSync(`${cert_dir}/test_key.pem`), - cert: fs.readFileSync(`${cert_dir}/test_cert.pem`), - ca: [ fs.readFileSync(`${cert_dir}/test_ca.pem`) ], + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: fixtures.readKey('rsa_ca.crt'), ciphers: 'AES256-GCM-SHA384' }; diff --git a/benchmark/tls/tls-connect.js b/benchmark/tls/tls-connect.js index fa6e2cb80abf06..4300f6841f0cd6 100644 --- a/benchmark/tls/tls-connect.js +++ b/benchmark/tls/tls-connect.js @@ -1,6 +1,5 @@ 'use strict'; -const fs = require('fs'); -const path = require('path'); +const fixtures = require('../../test/common/fixtures'); const tls = require('tls'); const common = require('../common.js'); @@ -18,11 +17,10 @@ var running = true; function main(conf) { dur = conf.dur; concurrency = conf.concurrency; - const cert_dir = path.resolve(__dirname, '../../test/fixtures'); const options = { - key: fs.readFileSync(`${cert_dir}/test_key.pem`), - cert: fs.readFileSync(`${cert_dir}/test_cert.pem`), - ca: [ fs.readFileSync(`${cert_dir}/test_ca.pem`) ], + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: fixtures.readKey('rsa_ca.crt'), ciphers: 'AES256-GCM-SHA384' }; diff --git a/test/async-hooks/test-graph.tls-write.js b/test/async-hooks/test-graph.tls-write.js index 5aee38e6b6841a..f8bee6a879d0b4 100644 --- a/test/async-hooks/test-graph.tls-write.js +++ b/test/async-hooks/test-graph.tls-write.js @@ -20,8 +20,8 @@ hooks.enable(); // const server = tls .createServer({ - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem') }) .on('listening', common.mustCall(onlistening)) .on('secureConnection', common.mustCall(onsecureConnection)) diff --git a/test/async-hooks/test-tlswrap.js b/test/async-hooks/test-tlswrap.js index d6dcd204703d9d..65a4087d1659c6 100644 --- a/test/async-hooks/test-tlswrap.js +++ b/test/async-hooks/test-tlswrap.js @@ -24,8 +24,8 @@ tls.DEFAULT_MAX_VERSION = 'TLSv1.2'; // const server = tls .createServer({ - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem') }) .on('listening', common.mustCall(onlistening)) .on('secureConnection', common.mustCall(onsecureConnection)) diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index fd7ca677f63266..d26872e7d55289 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -41,6 +41,9 @@ all: \ rsa_private_pkcs8.pem \ rsa_private_pkcs8_bad.pem \ rsa_public.pem \ + rsa_ca.crt \ + rsa_cert.crt \ + rsa_cert.pfx \ rsa_public_sha1_signature_signedby_rsa_private.sha1 \ rsa_public_sha1_signature_signedby_rsa_private_pkcs8.sha1 \ rsa_private_b.pem \ @@ -617,6 +620,15 @@ rsa_private_pkcs8_bad.pem: rsa_private_pkcs8.pem rsa_public.pem: rsa_private.pem openssl rsa -in rsa_private.pem -pubout -out rsa_public.pem +rsa_cert.crt: rsa_private.pem + openssl req -new -x509 -key rsa_private.pem -config rsa_cert.cnf -out rsa_cert.crt + +rsa_cert.pfx: rsa_cert.crt + openssl pkcs12 -export -passout 'pass:sample' -inkey rsa_private.pem -in rsa_cert.crt -out rsa_cert.pfx + +rsa_ca.crt: rsa_cert.crt + cp rsa_cert.crt rsa_ca.crt + rsa_public_sha1_signature_signedby_rsa_private.sha1: rsa_public.pem rsa_private.pem openssl dgst -sha1 -sign rsa_private.pem -out rsa_public_sha1_signature_signedby_rsa_private.sha1 rsa_public.pem diff --git a/test/fixtures/keys/rsa_ca.crt b/test/fixtures/keys/rsa_ca.crt new file mode 100644 index 00000000000000..ef94a341846101 --- /dev/null +++ b/test/fixtures/keys/rsa_ca.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIUOLbA0Gyeqh/vqRSR98jmSKzv3aswDQYJKoZIhvcNAQEL +BQAwgbAxCzAJBgNVBAYTAlVLMRQwEgYDVQQIDAtBY2tuYWNrIEx0ZDETMBEGA1UE +BwwKUmh5cyBKb25lczEQMA4GA1UECgwHbm9kZS5qczEdMBsGA1UECwwUVGVzdCBU +TFMgQ2VydGlmaWNhdGUxFDASBgNVBAsMC0VuZ2luZWVyaW5nMRIwEAYDVQQDDAls +b2NhbGhvc3QxGzAZBgkqhkiG9w0BCQEWDGFsZXhAYXViLmRldjAeFw0xOTA1Mjky +MDI5NTBaFw0xOTA2MjgyMDI5NTBaMIGwMQswCQYDVQQGEwJVSzEUMBIGA1UECAwL +QWNrbmFjayBMdGQxEzARBgNVBAcMClJoeXMgSm9uZXMxEDAOBgNVBAoMB25vZGUu +anMxHTAbBgNVBAsMFFRlc3QgVExTIENlcnRpZmljYXRlMRQwEgYDVQQLDAtFbmdp +bmVlcmluZzESMBAGA1UEAwwJbG9jYWxob3N0MRswGQYJKoZIhvcNAQkBFgxhbGV4 +QGF1Yi5kZXYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC33FiIiiex +wLe/P8DZx5HsqFlmUO7/lvJ7necJVNwqdZ3ax5jpQB0p6uxfqeOvzcN3k5V7UFb/ +Am+nkSNZMAZhsWzCU2Z4Pjh50QYz3f0Hour7/yIGStOLyYY3hgLK2K8TbhgjQPhd +kw9+QtKlpvbL8fLgONAoGrVOFnRQGcr70iFffsm79mgZhKVMgYiHPJqJgGHvCtkG +g9zMgS7p63+Q3ZWedtFS2RhMX3uCBy/mH6EOlRCNBbRmA4xxNzyf5GQaki3T+Iz9 +tOMjdPP+CwV2LqEdylmBuik8vrfTb3qIHLKKBAI8lXN26wWtA3kN4L7NP+cbKlCR +lqctvhmylLH1AgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQAD +ggEBAFeDkFYcL1pcVA3q1LNWmpDi9MQAOajSyk3bNj0+ckyuOlqaXH2gVAdQh+XB +LOFDXNwAAqMe7FEoyvIaQSFcatRhQnKFxQ9i0o1T8+6Aebjj5oo8lY5CGyOacQV8 +C6LMl4gd/duIoaWkjykiGjTH8SR6VXYhPTm03wQSMMX664E/8onsw6cLuz4COB9q +dhWhkBXiVj3fF9kLOYMiBWc7Mb2Glfs3NLpu7TTltOwNNMWNfzE9XByR7Tg4WtIu +8x45ibQKqUhHCh/jpWns2g/YZXXBrcvYREgakkvJZLV2Z+xeoV5oY071554BfMms +YxLnHtl1YKNg++DSmxeUNK+NLZA= +-----END CERTIFICATE----- diff --git a/test/fixtures/keys/rsa_cert.cnf b/test/fixtures/keys/rsa_cert.cnf new file mode 100644 index 00000000000000..5d30534012e40f --- /dev/null +++ b/test/fixtures/keys/rsa_cert.cnf @@ -0,0 +1,23 @@ +[ req ] +days = 99999 +distinguished_name = req_distinguished_name +attributes = req_attributes +prompt = no +x509_extensions = v3_ca + +[ req_distinguished_name ] +C = UK +ST = Acknack Ltd +L = Rhys Jones +O = node.js +0.OU = Test TLS Certificate +1.OU = Engineering +CN = localhost +emailAddress = alex@aub.dev + +[ req_attributes ] + +[ v3_ca ] +basicConstraints = CA:TRUE + +[ x509_extensions ] \ No newline at end of file diff --git a/test/fixtures/keys/rsa_cert.crt b/test/fixtures/keys/rsa_cert.crt new file mode 100644 index 00000000000000..ef94a341846101 --- /dev/null +++ b/test/fixtures/keys/rsa_cert.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIUOLbA0Gyeqh/vqRSR98jmSKzv3aswDQYJKoZIhvcNAQEL +BQAwgbAxCzAJBgNVBAYTAlVLMRQwEgYDVQQIDAtBY2tuYWNrIEx0ZDETMBEGA1UE +BwwKUmh5cyBKb25lczEQMA4GA1UECgwHbm9kZS5qczEdMBsGA1UECwwUVGVzdCBU +TFMgQ2VydGlmaWNhdGUxFDASBgNVBAsMC0VuZ2luZWVyaW5nMRIwEAYDVQQDDAls +b2NhbGhvc3QxGzAZBgkqhkiG9w0BCQEWDGFsZXhAYXViLmRldjAeFw0xOTA1Mjky +MDI5NTBaFw0xOTA2MjgyMDI5NTBaMIGwMQswCQYDVQQGEwJVSzEUMBIGA1UECAwL +QWNrbmFjayBMdGQxEzARBgNVBAcMClJoeXMgSm9uZXMxEDAOBgNVBAoMB25vZGUu +anMxHTAbBgNVBAsMFFRlc3QgVExTIENlcnRpZmljYXRlMRQwEgYDVQQLDAtFbmdp +bmVlcmluZzESMBAGA1UEAwwJbG9jYWxob3N0MRswGQYJKoZIhvcNAQkBFgxhbGV4 +QGF1Yi5kZXYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC33FiIiiex +wLe/P8DZx5HsqFlmUO7/lvJ7necJVNwqdZ3ax5jpQB0p6uxfqeOvzcN3k5V7UFb/ +Am+nkSNZMAZhsWzCU2Z4Pjh50QYz3f0Hour7/yIGStOLyYY3hgLK2K8TbhgjQPhd +kw9+QtKlpvbL8fLgONAoGrVOFnRQGcr70iFffsm79mgZhKVMgYiHPJqJgGHvCtkG +g9zMgS7p63+Q3ZWedtFS2RhMX3uCBy/mH6EOlRCNBbRmA4xxNzyf5GQaki3T+Iz9 +tOMjdPP+CwV2LqEdylmBuik8vrfTb3qIHLKKBAI8lXN26wWtA3kN4L7NP+cbKlCR +lqctvhmylLH1AgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQAD +ggEBAFeDkFYcL1pcVA3q1LNWmpDi9MQAOajSyk3bNj0+ckyuOlqaXH2gVAdQh+XB +LOFDXNwAAqMe7FEoyvIaQSFcatRhQnKFxQ9i0o1T8+6Aebjj5oo8lY5CGyOacQV8 +C6LMl4gd/duIoaWkjykiGjTH8SR6VXYhPTm03wQSMMX664E/8onsw6cLuz4COB9q +dhWhkBXiVj3fF9kLOYMiBWc7Mb2Glfs3NLpu7TTltOwNNMWNfzE9XByR7Tg4WtIu +8x45ibQKqUhHCh/jpWns2g/YZXXBrcvYREgakkvJZLV2Z+xeoV5oY071554BfMms +YxLnHtl1YKNg++DSmxeUNK+NLZA= +-----END CERTIFICATE----- diff --git a/test/fixtures/keys/rsa_cert.pfx b/test/fixtures/keys/rsa_cert.pfx new file mode 100644 index 0000000000000000000000000000000000000000..627f27bc7fe14d260d11d1e68d3be27369e9fa8e GIT binary patch literal 2629 zcmV-L3cB?$f(k(b0Ru3C3I_%WDuzgg_YDCD0ic2j_ymFp^e}=6@Gyb|rv?cshDe6@ z4FLxRpn?RLFoFb>0s#Opf&`5Q2`Yw2hW8Bt2LUh~1_~;MNQU8S zPEK;-&;-IL!+jVJ*t36KfTXxRXzyt3x}jDYiu@9E)J9LF>r^^`deMBaga6^WeqtW~ zRPB+e=0#h%jefzwZgIGI`_(Q(JaTPTyB-_+!BV`tr48R=y;8a1JV8KVz_ZE}n=Am( z$0-3@Uwl5!u&Gt(DBU>&B8$q5tw;JLyzt9K`H&R=!xrh}75Ml3^gK~@CW^DVdo~Q! z>a6-f5AznG=I6Tb=0h(oqzT}Sig@6_W~Q@UHEk@YrBp-1_ray-llfwbgz5)zydxaj z)xz9UUZ*@6bTJ#j)lb0d_r*BGT-iXLHfmp&EZx;$Q1!1d8QCm}?M z+J9|F50$}ORd>l$g#019YM$Kvuk-`hU#v^yJGuxmes(_5?ZaSUX-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S!bIE2OmjKDq_Q74X=)$-J?a4D2r{w#gzNHMgUb4#_4HL%wzgJ;Lew9kRYwdp{w20oq_t{7>wO`I4E#-qu1Axlgb=8lt)oZ(K2e97($BNdR`L}9+NA@ zVPy?%>DjNFW}8=VQte-$yb&Yc$nVmk#3QU?+FK(hwL=5lt`D46S4AB@6`{yAe$8zw z-4aJLQ=yGbM-L{KsZ*TTHLH2{ioF8kZ-Q1ay{+@@_@{0hu%g+4)~dO7qD4`0Y_PjG zB;VJ{>5@i3J*!rh(9Vs{#ZSTk)Nn3xA}QZ_kp1z>+=HMXREM|LNc08Zt#KjM@#C1$)8G> zf;(6eNe4<9J$3K-mmf^~-JAb9XZI>$9-zfif2RIKAhXn@e^!1|M8>K3xWA|85}uKb zfs`HP4G3Z>QEZFG?(%#oh?2-RU5H@}@#cOthTJDW2+;BQ{v2r8U>6 zbpvDZSY|$jaybLzIw{NOU`Kf)qA9(9PHrG(D2l8I*GvzyWfEQkr}n>8!*=6kz(`C~ z{lM7jduKW!GYUuzJLEKTdkBZeso-ED!dP(-P+k}SMyma`FFOq}T57we%T9-i$x|j* S8Gxb3C+JEY^Q3!!r~5DRBW1w= diff --git a/test/fixtures/test_key.pem b/test/fixtures/test_key.pem deleted file mode 100644 index 48fd93c9944ff3..00000000000000 --- a/test/fixtures/test_key.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDx3wdzpq2rvwm3Ucun1qAD/ClB+wW+RhR1nVix286QvaNqePAd -CAwwLL82NqXcVQRbQ4s95splQnwvjgkFdKVXFTjPKKJI5aV3wSRN61EBVPdYpCre -535yfG/uDysZFCnVQdnCZ1tnXAR8BirxCNjHqbVyIyBGjsNoNCEPb2R35QIDAQAB -AoGBAJNem9C4ftrFNGtQ2DB0Udz7uDuucepkErUy4MbFsc947GfENjDKJXr42Kx0 -kYx09ImS1vUpeKpH3xiuhwqe7tm4FsCBg4TYqQle14oxxm7TNeBwwGC3OB7hiokb -aAjbPZ1hAuNs6ms3Ybvvj6Lmxzx42m8O5DXCG2/f+KMvaNUhAkEA/ekrOsWkNoW9 -2n3m+msdVuxeek4B87EoTOtzCXb1dybIZUVv4J48VAiM43hhZHWZck2boD/hhwjC -M5NWd4oY6QJBAPPcgBVNdNZSZ8hR4ogI4nzwWrQhl9MRbqqtfOn2TK/tjMv10ALg -lPmn3SaPSNRPKD2hoLbFuHFERlcS79pbCZ0CQQChX3PuIna/gDitiJ8oQLOg7xEM -wk9TRiDK4kl2lnhjhe6PDpaQN4E4F0cTuwqLAoLHtrNWIcOAQvzKMrYdu1MhAkBm -Et3qDMnjDAs05lGT72QeN90/mPAcASf5eTTYGahv21cb6IBxM+AnwAPpqAAsHhYR -9h13Y7uYbaOjvuF23LRhAkBoI9eaSMn+l81WXOVUHnzh3ZwB4GuTyxMXXNOhuiFd -0z4LKAMh99Z4xQmqSoEkXsfM4KPpfhYjF/bwIcP5gOei ------END RSA PRIVATE KEY----- diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index 712a9c7e39977f..c96253bc44d450 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -41,9 +41,9 @@ const DH_NOT_SUITABLE_GENERATOR = crypto.constants.DH_NOT_SUITABLE_GENERATOR; require('internal/crypto/util').setDefaultEncoding('latin1'); // Test Certificates -const certPem = fixtures.readSync('test_cert.pem', 'ascii'); -const certPfx = fixtures.readSync('test_cert.pfx'); -const keyPem = fixtures.readSync('test_key.pem', 'ascii'); +const certPem = fixtures.readKey('rsa_cert.crt'); +const certPfx = fixtures.readKey('rsa_cert.pfx'); +const keyPem = fixtures.readKey('rsa_private.pem'); const rsaPubPem = fixtures.readKey('rsa_public.pem', 'ascii'); const rsaKeyPem = fixtures.readKey('rsa_private.pem', 'ascii'); diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js index 1e657b9e60d494..120a9f1f94f570 100644 --- a/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js @@ -11,8 +11,8 @@ const constants = crypto.constants; const fixtures = require('../common/fixtures'); // Test certificates -const certPem = fixtures.readSync('test_cert.pem', 'ascii'); -const keyPem = fixtures.readSync('test_key.pem', 'ascii'); +const certPem = fixtures.readKey('rsa_cert.crt'); +const keyPem = fixtures.readKey('rsa_private.pem'); const rsaKeySize = 2048; const rsaPubPem = fixtures.readKey('rsa_public.pem', 'ascii'); const rsaKeyPem = fixtures.readKey('rsa_private.pem', 'ascii'); diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js index 0c7f4fb0bc9e37..66c7ac7d8014df 100644 --- a/test/parallel/test-crypto-sign-verify.js +++ b/test/parallel/test-crypto-sign-verify.js @@ -11,9 +11,9 @@ const crypto = require('crypto'); const fixtures = require('../common/fixtures'); // Test certificates -const certPem = fixtures.readSync('test_cert.pem', 'ascii'); -const keyPem = fixtures.readSync('test_key.pem', 'ascii'); -const modSize = 1024; +const certPem = fixtures.readKey('rsa_cert.crt'); +const keyPem = fixtures.readKey('rsa_private.pem'); +const keySize = 2048; { const Sign = crypto.Sign; @@ -152,7 +152,7 @@ common.expectsError( { function testPSS(algo, hLen) { // Maximum permissible salt length - const max = modSize / 8 - hLen - 2; + const max = keySize / 8 - hLen - 2; function getEffectiveSaltLength(saltLength) { switch (saltLength) { diff --git a/test/parallel/test-crypto-verify-failure.js b/test/parallel/test-crypto-verify-failure.js index 7e9fda9f6791f6..ad7d5d4f86d52b 100644 --- a/test/parallel/test-crypto-verify-failure.js +++ b/test/parallel/test-crypto-verify-failure.js @@ -29,7 +29,7 @@ const crypto = require('crypto'); const tls = require('tls'); const fixtures = require('../common/fixtures'); -const certPem = fixtures.readSync('test_cert.pem', 'ascii'); +const certPem = fixtures.readKey('rsa_cert.crt'); const options = { key: fixtures.readKey('agent1-key.pem'), diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js index 86c617815f2726..9337621d37fcfb 100644 --- a/test/parallel/test-crypto.js +++ b/test/parallel/test-crypto.js @@ -37,7 +37,7 @@ const tls = require('tls'); const fixtures = require('../common/fixtures'); // Test Certificates -const certPfx = fixtures.readSync('test_cert.pfx'); +const certPfx = fixtures.readKey('rsa_cert.pfx'); // 'this' safety // https://github.com/joyent/node/issues/6690 diff --git a/test/parallel/test-https-client-reject.js b/test/parallel/test-https-client-reject.js index 729256df54ff8c..113b56fda66fe4 100644 --- a/test/parallel/test-https-client-reject.js +++ b/test/parallel/test-https-client-reject.js @@ -30,8 +30,8 @@ const assert = require('assert'); const https = require('https'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const server = https.createServer(options, common.mustCall(function(req, res) { @@ -72,7 +72,7 @@ function rejectUnauthorized() { function authorized() { const options = { port: server.address().port, - ca: [fixtures.readSync('test_cert.pem')] + ca: [fixtures.readKey('rsa_cert.crt')] }; options.agent = new https.Agent(options); const req = https.request(options, function(res) { diff --git a/test/parallel/test-https-client-renegotiation-limit.js b/test/parallel/test-https-client-renegotiation-limit.js index 4d3dda3d759e38..6b5aad2d30933f 100644 --- a/test/parallel/test-https-client-renegotiation-limit.js +++ b/test/parallel/test-https-client-renegotiation-limit.js @@ -50,8 +50,8 @@ const LIMITS = [0, 1, 2, 3, 5, 10, 16]; function test(next) { const options = { - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem'), }; const server = https.createServer(options, (req, res) => { diff --git a/test/parallel/test-https-drain.js b/test/parallel/test-https-drain.js index 98e43b27d4cebd..1c8a29258f26f6 100644 --- a/test/parallel/test-https-drain.js +++ b/test/parallel/test-https-drain.js @@ -29,8 +29,8 @@ const assert = require('assert'); const https = require('https'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const bufSize = 1024 * 1024; diff --git a/test/parallel/test-https-pfx.js b/test/parallel/test-https-pfx.js index 7cf23a7dfa17f4..4246913a037ec1 100644 --- a/test/parallel/test-https-pfx.js +++ b/test/parallel/test-https-pfx.js @@ -30,7 +30,7 @@ const fixtures = require('../common/fixtures'); const assert = require('assert'); const https = require('https'); -const pfx = fixtures.readSync('test_cert.pfx'); +const pfx = fixtures.readKey('rsa_cert.pfx'); const options = { host: '127.0.0.1', diff --git a/test/parallel/test-https-unix-socket-self-signed.js b/test/parallel/test-https-unix-socket-self-signed.js index 48207a7a22f52a..9db92ac2aed44a 100644 --- a/test/parallel/test-https-unix-socket-self-signed.js +++ b/test/parallel/test-https-unix-socket-self-signed.js @@ -10,8 +10,8 @@ tmpdir.refresh(); const fixtures = require('../common/fixtures'); const https = require('https'); const options = { - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem') }; const server = https.createServer(options, common.mustCall((req, res) => { diff --git a/test/parallel/test-tls-async-cb-after-socket-end.js b/test/parallel/test-tls-async-cb-after-socket-end.js index 49ca0cebc9b524..357cef30715d71 100644 --- a/test/parallel/test-tls-async-cb-after-socket-end.js +++ b/test/parallel/test-tls-async-cb-after-socket-end.js @@ -15,8 +15,8 @@ const tls = require('tls'); const options = { secureOptions: SSL_OP_NO_TICKET, - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const server = tls.createServer(options, common.mustCall()); diff --git a/test/parallel/test-tls-client-abort.js b/test/parallel/test-tls-client-abort.js index 09f252db308881..50c9a4b32437fc 100644 --- a/test/parallel/test-tls-client-abort.js +++ b/test/parallel/test-tls-client-abort.js @@ -27,8 +27,8 @@ if (!common.hasCrypto) const tls = require('tls'); const fixtures = require('../common/fixtures'); -const cert = fixtures.readSync('test_cert.pem'); -const key = fixtures.readSync('test_key.pem'); +const cert = fixtures.readKey('rsa_cert.crt'); +const key = fixtures.readKey('rsa_private.pem'); const conn = tls.connect({ cert, key, port: 0 }, common.mustNotCall()); conn.on('error', function() {}); diff --git a/test/parallel/test-tls-client-reject.js b/test/parallel/test-tls-client-reject.js index 329b78c271baaa..d41ad806ea3012 100644 --- a/test/parallel/test-tls-client-reject.js +++ b/test/parallel/test-tls-client-reject.js @@ -29,8 +29,8 @@ const tls = require('tls'); const fixtures = require('../common/fixtures'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const server = tls.createServer(options, function(socket) { @@ -80,7 +80,7 @@ function rejectUnauthorized() { function authorized() { console.log('connect authorized'); const socket = tls.connect(server.address().port, { - ca: [fixtures.readSync('test_cert.pem')], + ca: [fixtures.readKey('rsa_cert.crt')], servername: 'localhost' }, common.mustCall(function() { console.log('... authorized'); diff --git a/test/parallel/test-tls-client-renegotiation-limit.js b/test/parallel/test-tls-client-renegotiation-limit.js index 38dcf5a80be5a6..9a08efe96f5098 100644 --- a/test/parallel/test-tls-client-renegotiation-limit.js +++ b/test/parallel/test-tls-client-renegotiation-limit.js @@ -49,8 +49,8 @@ const LIMITS = [0, 1, 2, 3, 5, 10, 16]; function test(next) { const options = { - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem'), }; const server = tls.createServer(options, (conn) => { diff --git a/test/parallel/test-tls-connect-given-socket.js b/test/parallel/test-tls-connect-given-socket.js index 5fc5603dd1653b..f25cf4582d59b1 100644 --- a/test/parallel/test-tls-connect-given-socket.js +++ b/test/parallel/test-tls-connect-given-socket.js @@ -30,8 +30,8 @@ const tls = require('tls'); const net = require('net'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const server = tls.createServer(options, common.mustCall((socket) => { diff --git a/test/parallel/test-tls-connect-memleak.js b/test/parallel/test-tls-connect-memleak.js index 162d61fcdc7a66..b0dedfa0bba56d 100644 --- a/test/parallel/test-tls-connect-memleak.js +++ b/test/parallel/test-tls-connect-memleak.js @@ -35,8 +35,8 @@ const fixtures = require('../common/fixtures'); // added using `once()`, i.e. can be gc'ed once that event has occurred. const server = tls.createServer({ - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem') }).listen(0); let collected = false; diff --git a/test/parallel/test-tls-connect-no-host.js b/test/parallel/test-tls-connect-no-host.js index f6384743ac7081..97b95332c47c2e 100644 --- a/test/parallel/test-tls-connect-no-host.js +++ b/test/parallel/test-tls-connect-no-host.js @@ -8,8 +8,8 @@ if (!common.hasCrypto) const tls = require('tls'); const assert = require('assert'); -const cert = fixtures.readSync('test_cert.pem'); -const key = fixtures.readSync('test_key.pem'); +const cert = fixtures.readKey('rsa_cert.crt'); +const key = fixtures.readKey('rsa_private.pem'); // https://github.com/nodejs/node/issues/1489 // tls.connect(options) with no options.host should accept a cert with diff --git a/test/parallel/test-tls-connect-stream-writes.js b/test/parallel/test-tls-connect-stream-writes.js index 0c6ae2b660d502..001fe985800f28 100644 --- a/test/parallel/test-tls-connect-stream-writes.js +++ b/test/parallel/test-tls-connect-stream-writes.js @@ -9,9 +9,9 @@ const stream = require('stream'); const net = require('net'); const fixtures = require('../common/fixtures'); -const options = { key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem'), - ca: [ fixtures.readSync('test_ca.pem') ], +const options = { key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: [ fixtures.readKey('rsa_ca.crt') ], ciphers: 'AES256-GCM-SHA384' }; const content = 'hello world'; const recv_bufs = []; diff --git a/test/parallel/test-tls-destroy-stream.js b/test/parallel/test-tls-destroy-stream.js index b06d7728dc6764..a49e985a7e0204 100644 --- a/test/parallel/test-tls-destroy-stream.js +++ b/test/parallel/test-tls-destroy-stream.js @@ -18,9 +18,9 @@ tls.DEFAULT_MAX_VERSION = 'TLSv1.3'; const CONTENT = 'Hello World'; const tlsServer = tls.createServer( { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem'), - ca: [fixtures.readSync('test_ca.pem')], + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: [fixtures.readKey('rsa_ca.crt')], }, (socket) => { socket.on('close', common.mustCall()); diff --git a/test/parallel/test-tls-fast-writing.js b/test/parallel/test-tls-fast-writing.js index 398beb0d097701..af40cc33baeda0 100644 --- a/test/parallel/test-tls-fast-writing.js +++ b/test/parallel/test-tls-fast-writing.js @@ -28,9 +28,9 @@ const fixtures = require('../common/fixtures'); const assert = require('assert'); const tls = require('tls'); -const options = { key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem'), - ca: [ fixtures.readSync('test_ca.pem') ] }; +const options = { key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: [ fixtures.readKey('rsa_ca.crt') ] }; const server = tls.createServer(options, onconnection); let gotChunk = false; diff --git a/test/parallel/test-tls-handshake-exception.js b/test/parallel/test-tls-handshake-exception.js index 1ba4bc6438e2f9..4d8ea7d33ae7fb 100644 --- a/test/parallel/test-tls-handshake-exception.js +++ b/test/parallel/test-tls-handshake-exception.js @@ -21,8 +21,8 @@ if (process.argv[2] === 'child') { const { Duplex } = require('stream'); const { mustCall } = common; - const cert = fixtures.readSync('test_cert.pem'); - const key = fixtures.readSync('test_key.pem'); + const cert = fixtures.readKey('rsa_cert.crt'); + const key = fixtures.readKey('rsa_private.pem'); net.createServer(mustCall(onplaintext)).listen(0, mustCall(onlisten)); diff --git a/test/parallel/test-tls-hello-parser-failure.js b/test/parallel/test-tls-hello-parser-failure.js index 4b92f6bde3151c..07776dd89e9227 100644 --- a/test/parallel/test-tls-hello-parser-failure.js +++ b/test/parallel/test-tls-hello-parser-failure.js @@ -36,8 +36,8 @@ const tls = require('tls'); const net = require('net'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const bonkers = Buffer.alloc(1024 * 1024, 42); diff --git a/test/parallel/test-tls-inception.js b/test/parallel/test-tls-inception.js index f28f92373c5500..7310308e6f9876 100644 --- a/test/parallel/test-tls-inception.js +++ b/test/parallel/test-tls-inception.js @@ -32,8 +32,8 @@ const tls = require('tls'); const net = require('net'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const body = 'A'.repeat(40000); diff --git a/test/parallel/test-tls-interleave.js b/test/parallel/test-tls-interleave.js index 70f98f33e4f2b2..91449b5b3ae571 100644 --- a/test/parallel/test-tls-interleave.js +++ b/test/parallel/test-tls-interleave.js @@ -30,9 +30,9 @@ const tls = require('tls'); const fixtures = require('../common/fixtures'); -const options = { key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem'), - ca: [ fixtures.readSync('test_ca.pem') ] }; +const options = { key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: [ fixtures.readKey('rsa_ca.crt') ] }; const writes = [ 'some server data', diff --git a/test/parallel/test-tls-net-connect-prefer-path.js b/test/parallel/test-tls-net-connect-prefer-path.js index 263501ae0330ac..1b8231664dce38 100644 --- a/test/parallel/test-tls-net-connect-prefer-path.js +++ b/test/parallel/test-tls-net-connect-prefer-path.js @@ -29,8 +29,8 @@ function mkServer(lib, tcp, cb) { const args = [handler]; if (lib === tls) { args.unshift({ - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem') }); } const server = lib.createServer(...args); diff --git a/test/parallel/test-tls-no-sslv3.js b/test/parallel/test-tls-no-sslv3.js index 4cbb62e3d595f1..1acb1f93767404 100644 --- a/test/parallel/test-tls-no-sslv3.js +++ b/test/parallel/test-tls-no-sslv3.js @@ -11,8 +11,8 @@ const tls = require('tls'); const spawn = require('child_process').spawn; const fixtures = require('../common/fixtures'); -const cert = fixtures.readSync('test_cert.pem'); -const key = fixtures.readSync('test_key.pem'); +const cert = fixtures.readKey('rsa_cert.crt'); +const key = fixtures.readKey('rsa_private.pem'); const server = tls.createServer({ cert, key }, common.mustNotCall()); const errors = []; let stderr = ''; diff --git a/test/parallel/test-tls-pause.js b/test/parallel/test-tls-pause.js index e246acff807a91..120d6d87a7a913 100644 --- a/test/parallel/test-tls-pause.js +++ b/test/parallel/test-tls-pause.js @@ -32,8 +32,8 @@ const tls = require('tls'); const fixtures = require('../common/fixtures'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const bufSize = 1024 * 1024; diff --git a/test/parallel/test-tls-securepair-fiftharg.js b/test/parallel/test-tls-securepair-fiftharg.js index 0651f98c6d780d..9adb2bf424818b 100644 --- a/test/parallel/test-tls-securepair-fiftharg.js +++ b/test/parallel/test-tls-securepair-fiftharg.js @@ -9,8 +9,8 @@ const tls = require('tls'); const fixtures = require('../common/fixtures'); const sslcontext = tls.createSecureContext({ - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem') }); const pair = tls.createSecurePair(sslcontext, true, false, false, { diff --git a/test/parallel/test-tls-zero-clear-in.js b/test/parallel/test-tls-zero-clear-in.js index b2a07960d4138c..f24fb6f992e75d 100644 --- a/test/parallel/test-tls-zero-clear-in.js +++ b/test/parallel/test-tls-zero-clear-in.js @@ -28,8 +28,8 @@ if (!common.hasCrypto) const tls = require('tls'); const fixtures = require('../common/fixtures'); -const cert = fixtures.readSync('test_cert.pem'); -const key = fixtures.readSync('test_key.pem'); +const cert = fixtures.readKey('rsa_cert.crt'); +const key = fixtures.readKey('rsa_private.pem'); const server = tls.createServer({ cert, diff --git a/test/pummel/test-https-no-reader.js b/test/pummel/test-https-no-reader.js index ad0b56c1f3c7b1..31d2bfa2d3ca34 100644 --- a/test/pummel/test-https-no-reader.js +++ b/test/pummel/test-https-no-reader.js @@ -29,8 +29,8 @@ const https = require('https'); const fixtures = require('../common/fixtures'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const buf = Buffer.allocUnsafe(1024 * 1024); diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js index 9f5c073c9e2d06..13aee51175f618 100644 --- a/test/sequential/test-async-wrap-getasyncid.js +++ b/test/sequential/test-async-wrap-getasyncid.js @@ -266,9 +266,9 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check const { TCP, constants: TCPConstants } = internalBinding('tcp_wrap'); const tcp = new TCP(TCPConstants.SOCKET); - const ca = fixtures.readSync('test_ca.pem', 'ascii'); - const cert = fixtures.readSync('test_cert.pem', 'ascii'); - const key = fixtures.readSync('test_key.pem', 'ascii'); + const ca = fixtures.readKey('rsa_ca.crt'); + const cert = fixtures.readKey('rsa_cert.crt'); + const key = fixtures.readKey('rsa_private.pem'); const credentials = require('tls').createSecureContext({ ca, cert, key }); diff --git a/test/sequential/test-tls-connect.js b/test/sequential/test-tls-connect.js index 291747aea77b49..5cfec7ed04707d 100644 --- a/test/sequential/test-tls-connect.js +++ b/test/sequential/test-tls-connect.js @@ -33,8 +33,8 @@ const tls = require('tls'); // https://github.com/joyent/node/issues/1218 // uncatchable exception on TLS connection error { - const cert = fixtures.readSync('test_cert.pem'); - const key = fixtures.readSync('test_key.pem'); + const cert = fixtures.readKey('rsa_cert.crt'); + const key = fixtures.readKey('rsa_private.pem'); const options = { cert: cert, key: key, port: common.PORT }; const conn = tls.connect(options, common.mustNotCall()); @@ -47,8 +47,8 @@ const tls = require('tls'); // SSL_accept/SSL_connect error handling { - const cert = fixtures.readSync('test_cert.pem'); - const key = fixtures.readSync('test_key.pem'); + const cert = fixtures.readKey('rsa_cert.crt'); + const key = fixtures.readKey('rsa_private.pem'); assert.throws(() => { tls.connect({ From 7a448afc84148c59379ccd2c593d6b4c6be0594a Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Wed, 29 May 2019 11:56:48 -0700 Subject: [PATCH 09/17] test: remove pass-* certs PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/pass-cert.pem | 12 ------------ test/fixtures/pass-csr.pem | 10 ---------- test/fixtures/pass-key.pem | 17 ----------------- test/fixtures/raw-key.pem | 15 --------------- test/parallel/test-tls-passphrase.js | 26 +++++++++++++------------- 5 files changed, 13 insertions(+), 67 deletions(-) delete mode 100644 test/fixtures/pass-cert.pem delete mode 100644 test/fixtures/pass-csr.pem delete mode 100644 test/fixtures/pass-key.pem delete mode 100644 test/fixtures/raw-key.pem diff --git a/test/fixtures/pass-cert.pem b/test/fixtures/pass-cert.pem deleted file mode 100644 index 1b355a8ced4c38..00000000000000 --- a/test/fixtures/pass-cert.pem +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIB2TCCAUICCQDQv9q5AAtoEzANBgkqhkiG9w0BAQUFADAxMQswCQYDVQQGEwJK -UDEOMAwGA1UECBMFVG9reW8xEjAQBgNVBAoUCW5vZGVqc19qcDAeFw0xMTExMjYx -NzA0MDhaFw0yMTExMjMxNzA0MDhaMDExCzAJBgNVBAYTAkpQMQ4wDAYDVQQIEwVU -b2t5bzESMBAGA1UEChQJbm9kZWpzX2pwMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB -iQKBgQChmQeFwsaomtQbw9Nm55Dn6KSR9bkY8PDroQUeTNa90BlIbhGsKYm4l7bE -RaasFgOrkcQpk45fdDVYPjKxraZiGXXKjSIDYeDAIC/+CkwQKrejgCPmJs4gV4g+ -npvwi1gVr2NAg7fkJOyEW2TDp4dsAD8qtG8Aml0C1hJXwFYmBwIDAQABMA0GCSqG -SIb3DQEBBQUAA4GBAGJYkr3VgHUZSyGrdUWeGKiKS4EY3D4ki8Luv9Jf/IpxJLbZ -NGaKUbXSVYSW3US0yR1+lsNvWchmc0wLsbNEHbIiS4BQPkqX7F8FCthM1gwRLQPa -Sofz3dRNFKDmivG9mdbQDPD/duft7Kn6E3JS5myYUJ0dRKeYfOXLXCY2pZpG ------END CERTIFICATE----- diff --git a/test/fixtures/pass-csr.pem b/test/fixtures/pass-csr.pem deleted file mode 100644 index 8436f510549832..00000000000000 --- a/test/fixtures/pass-csr.pem +++ /dev/null @@ -1,10 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBcDCB2gIBADAxMQswCQYDVQQGEwJKUDEOMAwGA1UECBMFVG9reW8xEjAQBgNV -BAoUCW5vZGVqc19qcDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAoZkHhcLG -qJrUG8PTZueQ5+ikkfW5GPDw66EFHkzWvdAZSG4RrCmJuJe2xEWmrBYDq5HEKZOO -X3Q1WD4ysa2mYhl1yo0iA2HgwCAv/gpMECq3o4Aj5ibOIFeIPp6b8ItYFa9jQIO3 -5CTshFtkw6eHbAA/KrRvAJpdAtYSV8BWJgcCAwEAAaAAMA0GCSqGSIb3DQEBBQUA -A4GBAC9g7s3rG6G7JSTUOizY1u9Ij6QM9Y6PqQthr4OJHa+Hln5FJQahpgJmA4kC -WYoWvBMBgFPFBCYAj0yMPohrlAwlbd9MADe4gg3lxuO9UxXDzp/lOVRBAEa4n5i+ -Lw7VEiJtPha4NXgeNzxi5OyBJwxAOPFwsyCdR0SynlifTFHI ------END CERTIFICATE REQUEST----- diff --git a/test/fixtures/pass-key.pem b/test/fixtures/pass-key.pem deleted file mode 100644 index 968d5175d31593..00000000000000 --- a/test/fixtures/pass-key.pem +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIICojAcBgoqhkiG9w0BDAEDMA4ECMeM7uTE/aoCAgIIAASCAoDIIO3VAz+gb7td -FSOwV/zshzjr7n54r6Jg6fFyeIRrE3tgobr0loPfZUadtd1uxGMFlf4WKqXdk9u/ -Le2BCw34rTVCIlwritFHmcQ56xDKB5WTx+yuzxr97tmnFq00kTeHUcsPOb+eYU5B -2M0xWpYeEUP4iwQafUz6A6EOjSADYYpdgHHAzIY9VwECPkCqOJJti644OMNPUw8q -nvoESqwjAO1t2lymNUFk6zHg6FewiyCfjY6ucUCadbN74vUqKAJI45u7HQL8rxSf -95ncmjpHc+t7GUrQyzD68JaIGFN1Q8d09/ve3EOfoUoDGW+rE3hJ7oISeJfY3k7I -bBw6i0MO/ZfMs9wbmbMNDKzXQMolXfenK+KdD5Scp6eCeE14KqbQXuDoy+yA9CcZ -F87v4AyiY2o+A+cS56oY2R9Gc7uX51N8ZQGCuE/IEXeZbemV81br/EytJiZsXbPj -Kks1QkcsWnfsCUEeyF6IvIRXB70A4fuJ3+V9YoPoIawY18OoRPbMBBWkfMwEJIdB -2bW3joco0unImwRT6aXFghCnHOdXyQOMNtf1aCSDd/7o+Vac50Lwtuwpp7NsnUID -V9reIaEugHuM3PHbv3ygm8o3wb2VVRHgWV/wOReEtqLPhERyM1xfVs0y6xCGiE84 -N4uEzAwSGDFgEYACoj7LrqrVVEeVbrD0Gul2/fq9HnKOk6E/tygrwusasyL5vtSX -ZH/DeKK2XKq70bSu+1eGA/A+SqySckBe4QgEO7Qyb9xWqZhbqDyLg/xCUfDscMyP -WWW6nN56LcWI7UOEfWJVLTFCBil5T4e2qA4BiJTNc8zwwOM0BIyqvnhlENGbwQBI -KuSCzKIh ------END ENCRYPTED PRIVATE KEY----- diff --git a/test/fixtures/raw-key.pem b/test/fixtures/raw-key.pem deleted file mode 100644 index 3e27f9f8870ad0..00000000000000 --- a/test/fixtures/raw-key.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQChmQeFwsaomtQbw9Nm55Dn6KSR9bkY8PDroQUeTNa90BlIbhGs -KYm4l7bERaasFgOrkcQpk45fdDVYPjKxraZiGXXKjSIDYeDAIC/+CkwQKrejgCPm -Js4gV4g+npvwi1gVr2NAg7fkJOyEW2TDp4dsAD8qtG8Aml0C1hJXwFYmBwIDAQAB -AoGAVgZpAsQVjVwe3kj5GSbc9Rfbw/fTeXuKRWWKm/67soA9dVli/wt9zU62dPW/ -LIzrl0IZ8ygh+p6aZ0d1JTEUCPx7e0KocCmNg77i5AG0eK5i/KKjTWB4UGRDylfD -dnBXQc814bK+VB0mrcp46U/7tLGYkV2Kz/LiNpmxKwITS4ECQQDPoA6WIU87Eulq -OuVmJnFIQ2IR3SycVisO7TUq2MItq2U4BwsA3aQ4ehpP/uJdAfJEfwi2omRV5pGb -806pWkfPAkEAxz+igHS8tR11aLck71dD4BRBY7XZCUg6G4zmYYWsqj0yvM6c4Yn0 -HRcrZqFvV/xuMFphWEmMBhrqLvgy66yUSQJBALkei4LeRid0sDswMhMHGaAFvG4T -FtB5n8CaTPpb854GoKP42521ANP+QnGq36dvsdPStDEqz20rvA4hPLSQs08CQCV8 -eWxFikNg+XfsDQzilCiSZwMFcYHnjtckGSv75FJbFTKkhKuCMuVOOKIkeThKi8iZ -GHttyuRTKAASPjJM09ECQBrhlKJwYKuUDMp3qkLBgrXYqbFxZtkS2GeFMUfLcRlx -oMrTFEczz9lZ0huTuQYPeAAOY0Gd84mL0kQqTRTzNLs= ------END RSA PRIVATE KEY----- diff --git a/test/parallel/test-tls-passphrase.js b/test/parallel/test-tls-passphrase.js index 6ed19c74d22f73..e6b57b243f684b 100644 --- a/test/parallel/test-tls-passphrase.js +++ b/test/parallel/test-tls-passphrase.js @@ -28,9 +28,9 @@ const assert = require('assert'); const tls = require('tls'); const fixtures = require('../common/fixtures'); -const passKey = fixtures.readSync('pass-key.pem'); -const rawKey = fixtures.readSync('raw-key.pem'); -const cert = fixtures.readSync('pass-cert.pem'); +const passKey = fixtures.readKey('rsa_private_encrypted.pem'); +const rawKey = fixtures.readKey('rsa_private.pem'); +const cert = fixtures.readKey('rsa_cert.crt'); assert(Buffer.isBuffer(passKey)); assert(Buffer.isBuffer(cert)); @@ -39,7 +39,7 @@ assert.strictEqual(typeof cert.toString(), 'string'); const server = tls.Server({ key: passKey, - passphrase: 'passphrase', + passphrase: 'password', cert: cert, ca: [cert], requestCert: true, @@ -53,7 +53,7 @@ server.listen(0, common.mustCall(function() { tls.connect({ port: this.address().port, key: passKey, - passphrase: 'passphrase', + passphrase: 'password', cert: cert, rejectUnauthorized: false }, common.mustCall()); @@ -77,7 +77,7 @@ server.listen(0, common.mustCall(function() { tls.connect({ port: this.address().port, key: [passKey], - passphrase: 'passphrase', + passphrase: 'password', cert: [cert], rejectUnauthorized: false }, common.mustCall()); @@ -101,7 +101,7 @@ server.listen(0, common.mustCall(function() { tls.connect({ port: this.address().port, key: passKey.toString(), - passphrase: 'passphrase', + passphrase: 'password', cert: cert.toString(), rejectUnauthorized: false }, common.mustCall()); @@ -125,7 +125,7 @@ server.listen(0, common.mustCall(function() { tls.connect({ port: this.address().port, key: [passKey.toString()], - passphrase: 'passphrase', + passphrase: 'password', cert: [cert.toString()], rejectUnauthorized: false }, common.mustCall()); @@ -148,14 +148,14 @@ server.listen(0, common.mustCall(function() { // Object[] tls.connect({ port: this.address().port, - key: [{ pem: passKey, passphrase: 'passphrase' }], + key: [{ pem: passKey, passphrase: 'password' }], cert: cert, rejectUnauthorized: false }, common.mustCall()); tls.connect({ port: this.address().port, - key: [{ pem: passKey, passphrase: 'passphrase' }], + key: [{ pem: passKey, passphrase: 'password' }], passphrase: 'ignored', cert: cert, rejectUnauthorized: false @@ -164,14 +164,14 @@ server.listen(0, common.mustCall(function() { tls.connect({ port: this.address().port, key: [{ pem: passKey }], - passphrase: 'passphrase', + passphrase: 'password', cert: cert, rejectUnauthorized: false }, common.mustCall()); tls.connect({ port: this.address().port, - key: [{ pem: passKey.toString(), passphrase: 'passphrase' }], + key: [{ pem: passKey.toString(), passphrase: 'password' }], cert: cert, rejectUnauthorized: false }, common.mustCall()); @@ -288,7 +288,7 @@ assert.throws(function() { tls.connect({ port: server.address().port, key: [{ pem: passKey, passphrase: 'invalid' }], - passphrase: 'passphrase', // Valid but unused + passphrase: 'password', // Valid but unused cert: cert, rejectUnauthorized: false }); From c3512129b001dc1de64836982df87fe60d4a519a Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Wed, 29 May 2019 12:07:53 -0700 Subject: [PATCH 10/17] test: move dherror.pem to fixtures/keys/ PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/keys/Makefile | 4 ++++ test/fixtures/{ => keys}/dherror.pem | 3 ++- test/parallel/test-tls-dhe.js | 6 ++---- 3 files changed, 8 insertions(+), 5 deletions(-) rename test/fixtures/{ => keys}/dherror.pem (51%) diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index d26872e7d55289..198c8e2bd0d7fe 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -24,6 +24,7 @@ all: \ dh512.pem \ dh1024.pem \ dh2048.pem \ + dherror.pem \ dsa_params.pem \ dsa_private.pem \ dsa_private_encrypted.pem \ @@ -578,6 +579,9 @@ dh1024.pem: dh2048.pem: openssl dhparam -out dh2048.pem 2048 +dherror.pem: dh512.pem + sed 's/^[^-].*/AAAAAAAAAA/g' dh512.pem > dherror.pem + dsa_params.pem: openssl dsaparam -out dsa_params.pem 2048 diff --git a/test/fixtures/dherror.pem b/test/fixtures/keys/dherror.pem similarity index 51% rename from test/fixtures/dherror.pem rename to test/fixtures/keys/dherror.pem index 455795fc6cffd3..4f56268d19a23e 100644 --- a/test/fixtures/dherror.pem +++ b/test/fixtures/keys/dherror.pem @@ -1,3 +1,4 @@ -----BEGIN DH PARAMETERS----- -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAA +AAAAAAAAAA -----END DH PARAMETERS----- diff --git a/test/parallel/test-tls-dhe.js b/test/parallel/test-tls-dhe.js index 868686335077a5..ef645ce1b6c624 100644 --- a/test/parallel/test-tls-dhe.js +++ b/test/parallel/test-tls-dhe.js @@ -44,10 +44,8 @@ common.expectWarning('SecurityWarning', 'DH parameter is less than 2048 bits'); function loadDHParam(n) { - const params = [`dh${n}.pem`]; - if (n !== 'error') - params.unshift('keys'); - return fixtures.readSync(params); + const keyname = `dh${n}.pem`; + return fixtures.readKey(keyname); } function test(keylen, expectedCipher, cb) { From 91b587240ecbb5f8382b7f0bb8cc64c75aea68c8 Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Wed, 29 May 2019 12:11:34 -0700 Subject: [PATCH 11/17] test: remove uneeded certs in fixtures/ PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/cert.pem | 35 -------------------- test/fixtures/msca.pem | 15 --------- test/parallel/test-vm-syntax-error-stderr.js | 2 +- 3 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 test/fixtures/cert.pem delete mode 100644 test/fixtures/msca.pem diff --git a/test/fixtures/cert.pem b/test/fixtures/cert.pem deleted file mode 100644 index 33854c2046b232..00000000000000 --- a/test/fixtures/cert.pem +++ /dev/null @@ -1,35 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDNDCCAp2gAwIBAgIJAJvXL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O+BY/RHyP6fCodYvdNwyKslnI3 -US7eCSHZsVo= ------END CERTIFICATE----- ------BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDXcpu5xntssOi5SXya0LQuU5ijhq0l4sqJWAmxjsuMWSOCg99X -d9Pe44ZUBSchftdIMJBOtg7iXny7wWQ1LLy3tUfG85VYWZwVZ/t0CclCFkAC/g7E -Y/D9yqA+5N+t0DeXSGgNRjgINr2XD8tRwlLLzoLw1xkVAmajSwMrfof3KQIDAQAB -AoGBAIBHR/tT93ce2mJAJAXV0AJpWc+7x2pwX2FpXtQujnlxNZhnRlrBCRCD7h4m -t0bVS/86kyGaesBDvAbavfx/N5keYzzmmSp5Ht8IPqKPydGWdigk4x90yWvktai7 -dWuRKF94FXr0GUuBONb/dfHdp4KBtzN7oIF9WydYGGXA9ZmBAkEA8/k01bfwQZIu -AgcdNEM94Zcug1gSspXtUu8exNQX4+PNVbadghZb1+OnUO4d3gvWfqvAnaXD3KV6 -N4OtUhQQ0QJBAOIRbKMfaymQ9yE3CQQxYfKmEhHXWARXVwuYqIFqjmhSjSXx0l/P -7mSHz1I9uDvxkJev8sQgu1TKIyTOdqPH1tkCQQDPa6H1yYoj1Un0Q2Qa2Mg1kTjk -Re6vkjPQ/KcmJEOjZjtekgFbZfLzmwLXFXqjG2FjFFaQMSxR3QYJSJQEYjbhAkEA -sy7OZcjcXnjZeEkv61Pc57/7qIp/6Aj2JGnefZ1gvI1Z9Q5kCa88rA/9Iplq8pA4 -ZBKAoDW1ZbJGAsFmxc/6mQJAdPilhci0qFN86IGmf+ZBnwsDflIwHKDaVofti4wQ -sPWhSOb9VQjMXekI4Y2l8fqAVTS2Fn6+8jkVKxXBywSVCw== ------END RSA PRIVATE KEY----- diff --git a/test/fixtures/msca.pem b/test/fixtures/msca.pem deleted file mode 100644 index 82ae5e1bec7372..00000000000000 --- a/test/fixtures/msca.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD -VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv -bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv -b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV -UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU -cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds -b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH -iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS -r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4 -04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r -GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9 -3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P -lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ ------END CERTIFICATE----- diff --git a/test/parallel/test-vm-syntax-error-stderr.js b/test/parallel/test-vm-syntax-error-stderr.js index 137d5de432b398..e8d48235cf3ede 100644 --- a/test/parallel/test-vm-syntax-error-stderr.js +++ b/test/parallel/test-vm-syntax-error-stderr.js @@ -4,7 +4,7 @@ const assert = require('assert'); const child_process = require('child_process'); const fixtures = require('../common/fixtures'); -const wrong_script = fixtures.path('cert.pem'); +const wrong_script = fixtures.path('keys/rsa_cert.crt'); const p = child_process.spawn(process.execPath, [ '-e', From 487682a8063d16c93737ae5a71dfd6656a086b3b Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Wed, 29 May 2019 13:39:33 -0700 Subject: [PATCH 12/17] test: remove uneeded alice certs in fixtures/ PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/alice.crt | 24 ------------------- test/fixtures/multi-alice.crt | 22 ----------------- .../test-tls-peer-certificate-multi-keys.js | 8 +++---- 3 files changed, 4 insertions(+), 50 deletions(-) delete mode 100644 test/fixtures/alice.crt delete mode 100644 test/fixtures/multi-alice.crt diff --git a/test/fixtures/alice.crt b/test/fixtures/alice.crt deleted file mode 100644 index b4e986bc7bf2b1..00000000000000 --- a/test/fixtures/alice.crt +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID8DCCAtigAwIBAgIJALmw0zKhqlY1MA0GCSqGSIb3DQEBBQUAMFgxDjAMBgNV -BAMTBWFsaWNlMUYwRAYDVR0RFD11bmlmb3JtUmVzb3VyY2VJZGVudGlmaWVyOmh0 -dHA6Ly9sb2NhbGhvc3Q6ODAwMC9hbGljZS5mb2FmI21lMB4XDTExMDgyNDA1NTUx -NFoXDTExMDkyMzA1NTUxNFowWDEOMAwGA1UEAxMFYWxpY2UxRjBEBgNVHREUPXVu -aWZvcm1SZXNvdXJjZUlkZW50aWZpZXI6aHR0cDovL2xvY2FsaG9zdDo4MDAwL2Fs -aWNlLmZvYWYjbWUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDP4tdk -6NxAImrf5kpQVpuPvWij97H9ewFwWq0FOGONPD0JURXB89BCnhfC0+IHbTi+dhfB -DX9HY11NCoJm7juXv0uywv+7Zrlj37Q0RTedADmp237UUATRzmh7E+KZc6tHcZZ8 -rPs+ZnY7TXXsh4JRRc8blTy6aEN7/iYMXhk0mIpzjTha2Gq5OqBLustBkeFnoPQS -cac6TOWbEkxg80dI5jX/qK901RRwLztrA0QDeWB+HLbkjIErdAlz5pgo1Nu3vQt6 -vLdu7bBYsUa2Y2IaVBNLgmzEiZGwQJMjvbs5tLv8VYBCypb4I4vRJrkG4wWsUimM -+sR7SKHu9FFt2ZdHAgMBAAGjgbwwgbkwHQYDVR0OBBYEFA51eHepg7Tp5bi6Ao5F -B01/5+GoMIGJBgNVHSMEgYEwf4AUDnV4d6mDtOnluLoCjkUHTX/n4aihXKRaMFgx -DjAMBgNVBAMTBWFsaWNlMUYwRAYDVR0RFD11bmlmb3JtUmVzb3VyY2VJZGVudGlm -aWVyOmh0dHA6Ly9sb2NhbGhvc3Q6ODAwMC9hbGljZS5mb2FmI21lggkAubDTMqGq -VjUwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAreudH4Y7R9Vl2GJo -2xRUEwZiMj/ogomZ7B+IZtcuMIR8X2mzQ30xmPKaCy/fjbueqBroIDdxFeQ4eWZf -MD3AK/q5lJXwSInDjnn7jE9gNgLdQeCnajV0/QH+eDxIe/Alvx+RuvrDiNOudEs4 -vhqv5zEaL6VEXoWVb4/cghDbynQucSpyOMmGGPYYw2zmg0nNXdQauYWDUZIaDwQ6 -tM/pi2ewYubHPZdwJv5jvxTN3Z7RuuGHM+aLAZSAqSgAi0ml8PYYd2eRzXMaEI0c -eajcEvVa405aYT6dxuF1qqRDYx14As/R7O5RKCpz7wsxD6ICD/Ynv3GCUGxANQim -bcCjpg== ------END CERTIFICATE----- diff --git a/test/fixtures/multi-alice.crt b/test/fixtures/multi-alice.crt deleted file mode 100644 index db573857ec401a..00000000000000 --- a/test/fixtures/multi-alice.crt +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDnjCCAoYCCQCXooHS0l6bHDANBgkqhkiG9w0BAQUFADCBkDELMAkGA1UEBhMC -QVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdp -dHMgUHR5IEx0ZDE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bblW3jTC8c7+ -Cu1gNEM083vUq6/UxJUM8lOM ------END CERTIFICATE----- diff --git a/test/parallel/test-tls-peer-certificate-multi-keys.js b/test/parallel/test-tls-peer-certificate-multi-keys.js index a2548d6bcffb9e..ce4a0d406f9ea1 100644 --- a/test/parallel/test-tls-peer-certificate-multi-keys.js +++ b/test/parallel/test-tls-peer-certificate-multi-keys.js @@ -29,8 +29,8 @@ const tls = require('tls'); const fixtures = require('../common/fixtures'); const options = { - key: fixtures.readSync('agent.key'), - cert: fixtures.readSync('multi-alice.crt') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const server = tls.createServer(options, function(cleartext) { @@ -42,7 +42,7 @@ server.once('secureConnection', common.mustCall(function(socket) { // The server's local cert is the client's peer cert. assert.deepStrictEqual( cert.subject.OU, - ['Information Technology', 'Engineering', 'Marketing'] + ['Test TLS Certificate', 'Engineering'] ); })); @@ -54,7 +54,7 @@ server.listen(0, common.mustCall(function() { const peerCert = socket.getPeerCertificate(); assert.deepStrictEqual( peerCert.subject.OU, - ['Information Technology', 'Engineering', 'Marketing'] + ['Test TLS Certificate', 'Engineering'] ); server.close(); })); From 6807e677d99386099c8bc6b6c6d069e6060e1306 Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Wed, 29 May 2019 15:47:10 -0700 Subject: [PATCH 13/17] test: move foafssl certs to fixtures/keys/ PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/foafssl.crt | 25 --------------- test/fixtures/foafssl.key | 32 ------------------- test/fixtures/keys/Makefile | 14 ++++++++ test/fixtures/keys/rsa_cert_foafssl_b.cnf | 24 ++++++++++++++ test/fixtures/keys/rsa_cert_foafssl_b.crt | 24 ++++++++++++++ .../fixtures/keys/rsa_cert_foafssl_b.exponent | 1 + test/fixtures/keys/rsa_cert_foafssl_b.modulus | 1 + test/parallel/test-https-foafssl.js | 24 ++++++-------- 8 files changed, 73 insertions(+), 72 deletions(-) delete mode 100644 test/fixtures/foafssl.crt delete mode 100644 test/fixtures/foafssl.key create mode 100644 test/fixtures/keys/rsa_cert_foafssl_b.cnf create mode 100644 test/fixtures/keys/rsa_cert_foafssl_b.crt create mode 100644 test/fixtures/keys/rsa_cert_foafssl_b.exponent create mode 100644 test/fixtures/keys/rsa_cert_foafssl_b.modulus diff --git a/test/fixtures/foafssl.crt b/test/fixtures/foafssl.crt deleted file mode 100644 index 4a95dcd714a8ca..00000000000000 --- a/test/fixtures/foafssl.crt +++ /dev/null @@ -1,25 +0,0 @@ -Bag Attributes - friendlyName: Me's Not a Certification Authority ID - localKeyID: 98 CC 02 91 83 8D 14 4A 60 40 B7 11 E8 EF A9 01 4B D7 16 8A -subject=/O=FOAF+SSL/OU=The Community Of Self Signers/UID=http://example.com/#me/CN=Me -issuer=/O=FOAF+SSL/OU=The Community of Self Signers/CN=Not a Certification Authority ------BEGIN CERTIFICATE----- -MIIDVDCCAr2gAwIBAgIQRLIhwZ2N3ciEdpWb6kPmPzANBgkqhkiG9w0BAQUFADBj -MREwDwYDVQQKDAhGT0FGK1NTTDEmMCQGA1UECwwdVGhlIENvbW11bml0eSBvZiBT -ZWxmIFNpZ25lcnMxJjAkBgNVBAMMHU5vdCBhIENlcnRpZmljYXRpb24gQXV0aG9y -aXR5MB4XDTExMDgzMDE3MzIwNFoXDTEyMDgyMDE5MzIwNFowcDERMA8GA1UECgwI -Rk9BRitTU0wxJjAkBgNVBAsMHVRoZSBDb21tdW5pdHkgT2YgU2VsZiBTaWduZXJz -MSYwJAYKCZImiZPyLGQBAQwWaHR0cDovL2V4YW1wbGUuY29tLyNtZTELMAkGA1UE -AwwCTWUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCm9EqcJXkUMSFP -XIevngQBd6i7iayAP34Ju8OlUZ80nNm5xAvkNtCqgjqUFH4myJJIraK+PdTTTowo -lkaUsgR9IXtPEpk3Hqk6g8iauUQHJBMeZfKwFh3pVgzenBNFVVKy9Jzw+wDY13Uy -MkkT9vgP8p0KEx0p2wav+L4ZG3kg3C2uHCbqgqR4R6EDke879qq7PMQP+CEAsDpP -D/GAknjk3f2n3pVO1W3HrZpH7rw313GjZvxgpby3I3O+wYBkmz76DpCScHIQtBuQ -Ayuxi8kfIEbr2vEZH0pOJtcYecTHhnti/NUI6M5m6C0SinHpFYCfz0To3ndAZ/He -XXC5wDaHAgMBAAGjeDB2MAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgLsMBEG -CWCGSAGG+EIBAQQEAwIFoDAdBgNVHQ4EFgQU3gJIUFpe8rKklsjEdsxlaT6rZhow -JAYDVR0RAQH/BBowGIYWaHR0cDovL2V4YW1wbGUuY29tLyNtZTANBgkqhkiG9w0B -AQUFAAOBgQBLhwWbYMdeSkVZ4biVUle+XHP4Gv8V9WSfldvgn1PntS1lpVR46Exl -AkLO1SrnN5WHeAjv6VNb3KmTF+QhLt/4a1l9CEEeZSg5ml5aeXE+veobgypDoam+ -NKYAeIW9Wx+HcgBL4leIX3WiCKu/eal+a5ro18LQ8hkZqryHeVESIw== ------END CERTIFICATE----- diff --git a/test/fixtures/foafssl.key b/test/fixtures/foafssl.key deleted file mode 100644 index facbec5541be27..00000000000000 --- a/test/fixtures/foafssl.key +++ /dev/null @@ -1,32 +0,0 @@ -Bag Attributes - friendlyName: Me's Not a Certification Authority ID - localKeyID: 98 CC 02 91 83 8D 14 4A 60 40 B7 11 E8 EF A9 01 4B D7 16 8A -Key Attributes: ------BEGIN PRIVATE KEY----- -MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCm9EqcJXkUMSFP -XIevngQBd6i7iayAP34Ju8OlUZ80nNm5xAvkNtCqgjqUFH4myJJIraK+PdTTTowo -lkaUsgR9IXtPEpk3Hqk6g8iauUQHJBMeZfKwFh3pVgzenBNFVVKy9Jzw+wDY13Uy -MkkT9vgP8p0KEx0p2wav+L4ZG3kg3C2uHCbqg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-6B5bbNduf2HEsdxTZMDhYJAo2jtZFxVcBzAFBb7A0k7qNsh6OLY0zBO+4Wy9vujR -8sKfTuz157u9WmwAs27pJ0RKM3I7zCIjJxqIe5/CBruTlCJAx2LRFljsoEb31aAb -88Owi12ULAq8m2wBVCsa2uhYnUqC6cIzGTaZdsMPEwKBgQDJXI+J2d36IWzFrByH -yskssFldbLxm/7EexzAYuoSpHuQIxGJYHTHn6CZhqrX8UbxVnS909ES+17kdLZVP -egvaxn1mtfZInnH64PiQDQrsNnbP4Zg8yvLvIcEVIPqnSQ5QrhdR29tjYuDwUIKM -4BMR2yfkFp6URRX7ZD1UQsduww== ------END PRIVATE KEY----- diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index 198c8e2bd0d7fe..ca523f9f20cdd3 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -50,6 +50,9 @@ all: \ rsa_private_b.pem \ I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256 \ rsa_public_b.pem \ + rsa_cert_foafssl_b.crt \ + rsa_cert_foafssl_b.modulus \ + rsa_cert_foafssl_b.exponent \ rsa_spkac.spkac \ rsa_spkac_invalid.spkac \ rsa_private_1024.pem \ @@ -648,6 +651,17 @@ I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256: rsa_private_b.pe rsa_public_b.pem: rsa_private_b.pem openssl rsa -in rsa_private_b.pem -pubout -out rsa_public_b.pem +rsa_cert_foafssl_b.crt: rsa_private_b.pem + openssl req -new -x509 -config rsa_cert_foafssl_b.cnf -key rsa_private_b.pem -out rsa_cert_foafssl_b.crt + +# The 'modulus=' in the output must be stripped out +rsa_cert_foafssl_b.modulus: rsa_cert_foafssl_b.crt + openssl x509 -modulus -in rsa_cert_foafssl_b.crt -noout | cut -c 9- > rsa_cert_foafssl_b.modulus + +# Have to parse out the hex exponent +rsa_cert_foafssl_b.exponent: rsa_cert_foafssl_b.crt + openssl x509 -in rsa_cert_foafssl_b.crt -text | grep -o 'Exponent:.*' | sed 's/\(.*(\|).*\)//g' > rsa_cert_foafssl_b.exponent + # openssl outputs `SPKAC=[SPKAC]`. That prefix needs to be removed to work with node rsa_spkac.spkac: rsa_private.pem openssl spkac -key rsa_private.pem -challenge this-is-a-challenge | cut -c 7- > rsa_spkac.spkac diff --git a/test/fixtures/keys/rsa_cert_foafssl_b.cnf b/test/fixtures/keys/rsa_cert_foafssl_b.cnf new file mode 100644 index 00000000000000..38d6dd36f7bf22 --- /dev/null +++ b/test/fixtures/keys/rsa_cert_foafssl_b.cnf @@ -0,0 +1,24 @@ +[ req ] +days = 99999 +distinguished_name = req_distinguished_name +attributes = req_attributes +prompt = no +x509_extensions = v3_ca + +[ req_distinguished_name ] +C = UK +ST = "FOAF+SSL Auth Certificate" +L = Rhys Jones +O = node.js +OU = Test TLS Certificate +CN = localhost +emailAddress = alex@aub.dev + +[ req_attributes ] + +[ v3_ca ] +basicConstraints = CA:FALSE +subjectAltName = @alt_names + +[ alt_names ] +URI = http://example.com/\#me diff --git a/test/fixtures/keys/rsa_cert_foafssl_b.crt b/test/fixtures/keys/rsa_cert_foafssl_b.crt new file mode 100644 index 00000000000000..fa4db56c1f2b92 --- /dev/null +++ b/test/fixtures/keys/rsa_cert_foafssl_b.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIIEEDCCAvigAwIBAgIUAhzZrkGH3j4aXirSjA6n87moF9kwDQYJKoZIhvcNAQEL +BQAwgagxCzAJBgNVBAYTAlVLMSIwIAYDVQQIDBlGT0FGK1NTTCBBdXRoIENlcnRp +ZmljYXRlMRMwEQYDVQQHDApSaHlzIEpvbmVzMRAwDgYDVQQKDAdub2RlLmpzMR0w +GwYDVQQLDBRUZXN0IFRMUyBDZXJ0aWZpY2F0ZTESMBAGA1UEAwwJbG9jYWxob3N0 +MRswGQYJKoZIhvcNAQkBFgxhbGV4QGF1Yi5kZXYwHhcNMTkwNTI5MjIzMjM1WhcN +MTkwNjI4MjIz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END CERTIFICATE----- diff --git a/test/fixtures/keys/rsa_cert_foafssl_b.exponent b/test/fixtures/keys/rsa_cert_foafssl_b.exponent new file mode 100644 index 00000000000000..ac0ecd69753412 --- /dev/null +++ b/test/fixtures/keys/rsa_cert_foafssl_b.exponent @@ -0,0 +1 @@ +0x10001 diff --git a/test/fixtures/keys/rsa_cert_foafssl_b.modulus b/test/fixtures/keys/rsa_cert_foafssl_b.modulus new file mode 100644 index 00000000000000..7f7f1f02cf0285 --- /dev/null +++ b/test/fixtures/keys/rsa_cert_foafssl_b.modulus @@ -0,0 +1 @@ +C9BD60AEB37EDBD7F179E11B4DA4848DAE932834E94FF5979EAAC5092FA1EC861C9C3A0057072C3D4E4565E50FBCB28CCE2F4D1D2277E0B402BABA87807F17F9CC34613DE07584BFEEAA10897B3ECCABFAD7935CB6D0F7C6540B71E63E370CE7A0F5F2C99C0E799AB25391E2A9BAEABBA85DAFA81062880C34B9F6371056DA919E81DEBE6463025F7FBF06D30FFFAB579ADB588D8FB284DD92AC6CF970A856A5C1E20BA5FE07BB822A8299CBEB768D4C5854A5305ABD59B8CF24A529EE54272FD4EA0C1848A610703BBFF79A17FCBECFF55D43863CF068539D537829BB6067EA3D3E8863C4B154EB655E4C02E2C54E663D029281220229F8DEBF415452EAC5EB diff --git a/test/parallel/test-https-foafssl.js b/test/parallel/test-https-foafssl.js index 4e1a8fbc4c6b30..43057817043789 100644 --- a/test/parallel/test-https-foafssl.js +++ b/test/parallel/test-https-foafssl.js @@ -33,21 +33,15 @@ const https = require('https'); const spawn = require('child_process').spawn; const options = { - key: fixtures.readSync('agent.key'), - cert: fixtures.readSync('agent.crt'), + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), requestCert: true, rejectUnauthorized: false }; -const modulus = 'A6F44A9C25791431214F5C87AF9E040177A8BB89AC803F7E09BBC3A5519F' + - '349CD9B9C40BE436D0AA823A94147E26C89248ADA2BE3DD4D34E8C289646' + - '94B2047D217B4F1299371EA93A83C89AB9440724131E65F2B0161DE9560C' + - 'DE9C13455552B2F49CF0FB00D8D77532324913F6F80FF29D0A131D29DB06' + - 'AFF8BE191B7920DC2DAE1C26EA82A47847A10391EF3BF6AABB3CC40FF821' + - '00B03A4F0FF1809278E4DDFDA7DE954ED56DC7AD9A47EEBC37D771A366FC' + - '60A5BCB72373BEC180649B3EFA0E9092707210B41B90032BB18BC91F2046' + - 'EBDAF1191F4A4E26D71879C4C7867B62FCD508E8CE66E82D128A71E91580' + - '9FCF44E8DE774067F1DE5D70B9C03687'; +const webIdUrl = 'URI:http://example.com/#me'; +const modulus = fixtures.readKey('rsa_cert_foafssl_b.modulus', 'ascii').replace(/\n/g, ''); +const exponent = fixtures.readKey('rsa_cert_foafssl_b.exponent', 'ascii').replace(/\n/g, ''); const CRLF = '\r\n'; const body = 'hello world\n'; @@ -58,8 +52,8 @@ const server = https.createServer(options, common.mustCall(function(req, res) { cert = req.connection.getPeerCertificate(); - assert.strictEqual(cert.subjectaltname, 'URI:http://example.com/#me'); - assert.strictEqual(cert.exponent, '0x10001'); + assert.strictEqual(cert.subjectaltname, webIdUrl); + assert.strictEqual(cert.exponent, exponent); assert.strictEqual(cert.modulus, modulus); res.writeHead(200, { 'content-type': 'text/plain' }); res.end(body); @@ -69,8 +63,8 @@ server.listen(0, function() { const args = ['s_client', '-quiet', '-connect', `127.0.0.1:${this.address().port}`, - '-cert', fixtures.path('foafssl.crt'), - '-key', fixtures.path('foafssl.key')]; + '-cert', fixtures.path('keys/rsa_cert_foafssl_b.crt'), + '-key', fixtures.path('keys/rsa_private_b.pem')]; const client = spawn(common.opensslCli, args); From d7276d2fd234b95b4f9a8f097bda63a73351b89c Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Wed, 29 May 2019 16:03:21 -0700 Subject: [PATCH 14/17] test: remove uneeded agent keypair in fixtures/ PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/agent.crt | 21 --------------- test/fixtures/agent.key | 27 ------------------- test/parallel/test-tls-securepair-server.js | 4 +-- test/parallel/test-tls-session-cache.js | 8 +++--- test/parallel/test-tls-ticket-cluster.js | 4 +-- test/sequential/test-tls-securepair-client.js | 2 +- test/sequential/test-tls-session-timeout.js | 4 +-- 7 files changed, 11 insertions(+), 59 deletions(-) delete mode 100644 test/fixtures/agent.crt delete mode 100644 test/fixtures/agent.key diff --git a/test/fixtures/agent.crt b/test/fixtures/agent.crt deleted file mode 100644 index 5883cd44961e67..00000000000000 --- a/test/fixtures/agent.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDXTCCAkWgAwIBAgIJAMUSOvlaeyQHMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV -BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX -aWRnaXRzIFB0eSBMdGQwHhcNMTAxMTE2MDkzMjQ5WhcNMTMxMTE1MDkzMjQ5WjBF -MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50 -ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEAz+LXZOjcQCJq3+ZKUFabj71oo/ex/XsBcFqtBThjjTw9CVEVwfPQQp4X -wtPiB204vnYXwQ1/R2NdTQqCZu47l79LssL/u2a5Y9+0NEU3nQA5qdt+1FAE0c5o -exPimXOrR3GWfKz7PmZ2O0117IeCUUXPG5U8umhDe/4mDF4ZNJiKc404WthquTqg -S7rLQZHhZ6D0EnGnOkzlmxJMYPNHSOY1/6ivdNUUcC87awNEA3lgfhy25IyBK3QJ -c+aYKNTbt70Lery3bu2wWLFGtmNiGlQTS4JsxImRsECTI727ObS7/FWAQsqW+COL -0Sa5BuMFrFIpjPrEe0ih7vRRbdmXRwIDAQABo1AwTjAdBgNVHQ4EFgQUDnV4d6mD -tOnluLoCjkUHTX/n4agwHwYDVR0jBBgwFoAUDnV4d6mDtOnluLoCjkUHTX/n4agw -DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAFwV4MQfTo+qMv9JMiyno -IEiqfOz4RgtmBqRnXUffcjS2dhc7/z+FPZnM79Kej8eLHoVfxCyWRHFlzm93vEdv -wxOCrD13EDOi08OOZfxWyIlCa6Bg8cMAKqQzd2OvQOWqlRWBTThBJIhWflU33izX -Qn5GdmYqhfpc+9ZHHGhvXNydtRQkdxVK2dZNzLBvBlLlRmtoClU7xm3A+/5dddeP -AQHEPtyFlUw49VYtZ3ru6KqPms7MKvcRhYLsy9rwSfuuniMlx4d0bDR7TOkw0QQS -A0N8MGQRQpzl4mw4jLzyM5d5QtuGBh2P6hPGa0YQxtI3RPT/p6ENzzBiAKXiSfzo -xw== ------END CERTIFICATE----- diff --git a/test/fixtures/agent.key b/test/fixtures/agent.key deleted file mode 100644 index f31ff3d9441075..00000000000000 --- a/test/fixtures/agent.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAz+LXZOjcQCJq3+ZKUFabj71oo/ex/XsBcFqtBThjjTw9CVEV -wfPQQp4XwtPiB204vnYXwQ1/R2NdTQqCZu47l79LssL/u2a5Y9+0NEU3nQA5qdt+ -1FAE0c5oexPimXOrR3GWfKz7PmZ2O0117IeCUUXPG5U8umhDe/4mDF4ZNJiKc404 -WthquTqgS7rLQZHhZ6D0EnGnOkzlmxJMYPNHSOY1/6ivdNUUcC87awNEA3lgfhy2 -5IyBK3QJc+aYKNTbt70Lery3bu2wWLFGtmNiGlQTS4JsxImRsECTI727ObS7/FWA -QsqW+COL0Sa5BuMFrFIpjPrEe0ih7vRRbdmXRwIDAQABAoIBAGe4+9VqZfJN+dsq -8Osyuz01uQ8OmC0sAWTIqUlQgENIyf9rCJsUBlYmwR5BT6Z69XP6QhHdpSK+TiAR -XUz0EqG9HYz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E2A8vcaX6zy2xkZlGHQCpWRtEM5R01OWJQaH -HsHMmQZGUQVoDm1oRkDhrTFK4K3ukc3rAxzeTZ96utOQN8/KJsTv ------END RSA PRIVATE KEY----- diff --git a/test/parallel/test-tls-securepair-server.js b/test/parallel/test-tls-securepair-server.js index 92234fb4108fc5..5e3cd4130cba9f 100644 --- a/test/parallel/test-tls-securepair-server.js +++ b/test/parallel/test-tls-securepair-server.js @@ -33,8 +33,8 @@ const net = require('net'); const spawn = require('child_process').spawn; const fixtures = require('../common/fixtures'); -const key = fixtures.readSync('agent.key').toString(); -const cert = fixtures.readSync('agent.crt').toString(); +const key = fixtures.readKey('rsa_private.pem'); +const cert = fixtures.readKey('rsa_cert.crt'); function log(a) { console.error(`***server*** ${a}`); diff --git a/test/parallel/test-tls-session-cache.js b/test/parallel/test-tls-session-cache.js index 2a74be0521df21..34c4a71ab2c149 100644 --- a/test/parallel/test-tls-session-cache.js +++ b/test/parallel/test-tls-session-cache.js @@ -41,8 +41,8 @@ doTest({ tickets: false }, function() { }); function doTest(testOptions, callback) { - const key = fixtures.readSync('agent.key'); - const cert = fixtures.readSync('agent.crt'); + const key = fixtures.readKey('rsa_private.pem'); + const cert = fixtures.readKey('rsa_cert.crt'); const options = { key, cert, @@ -101,8 +101,8 @@ function doTest(testOptions, callback) { '-tls1', '-connect', `localhost:${this.address().port}`, '-servername', 'ohgod', - '-key', fixtures.path('agent.key'), - '-cert', fixtures.path('agent.crt'), + '-key', fixtures.path('keys/rsa_private.pem'), + '-cert', fixtures.path('keys/rsa_cert.crt'), '-reconnect' ].concat(testOptions.tickets ? [] : '-no_ticket'); diff --git a/test/parallel/test-tls-ticket-cluster.js b/test/parallel/test-tls-ticket-cluster.js index 234c1bad09c9a7..cc4f46e1430aea 100644 --- a/test/parallel/test-tls-ticket-cluster.js +++ b/test/parallel/test-tls-ticket-cluster.js @@ -94,8 +94,8 @@ if (cluster.isMaster) { return; } -const key = fixtures.readSync('agent.key'); -const cert = fixtures.readSync('agent.crt'); +const key = fixtures.readKey('rsa_private.pem'); +const cert = fixtures.readKey('rsa_cert.crt'); const options = { key, cert }; diff --git a/test/sequential/test-tls-securepair-client.js b/test/sequential/test-tls-securepair-client.js index eec65af8a101ed..c450410baf907c 100644 --- a/test/sequential/test-tls-securepair-client.js +++ b/test/sequential/test-tls-securepair-client.js @@ -42,7 +42,7 @@ test1(); // simple/test-tls-securepair-client function test1() { - test('agent.key', 'agent.crt', null, test2); + test('keys/rsa_private.pem', 'keys/rsa_cert.crt', null, test2); } // simple/test-tls-ext-key-usage diff --git a/test/sequential/test-tls-session-timeout.js b/test/sequential/test-tls-session-timeout.js index 4e430b7135df30..86a29eed46fe73 100644 --- a/test/sequential/test-tls-session-timeout.js +++ b/test/sequential/test-tls-session-timeout.js @@ -51,8 +51,8 @@ function doTest() { const SESSION_TIMEOUT = 1; - const key = fixtures.readSync('agent.key'); - const cert = fixtures.readSync('agent.crt'); + const key = fixtures.readKey('rsa_private.pem'); + const cert = fixtures.readKey('rsa_cert.crt'); const options = { key: key, cert: cert, From 1d3202e069174bfe8a915c26f155e73c5f35ea42 Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Wed, 29 May 2019 17:03:05 -0700 Subject: [PATCH 15/17] test: change fixtures.readSync to fixtures.readKey PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/parallel/test-tls-getprotocol.js | 4 ++-- test/parallel/test-tls-keylog-tlsv13.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-tls-getprotocol.js b/test/parallel/test-tls-getprotocol.js index 20018241e33572..ec3642cbf74614 100644 --- a/test/parallel/test-tls-getprotocol.js +++ b/test/parallel/test-tls-getprotocol.js @@ -18,8 +18,8 @@ const clientConfigs = [ const serverConfig = { secureProtocol: 'TLS_method', - key: fixtures.readSync('/keys/agent2-key.pem'), - cert: fixtures.readSync('/keys/agent2-cert.pem') + key: fixtures.readKey('agent2-key.pem'), + cert: fixtures.readKey('agent2-cert.pem') }; const server = tls.createServer(serverConfig, common.mustCall(function() { diff --git a/test/parallel/test-tls-keylog-tlsv13.js b/test/parallel/test-tls-keylog-tlsv13.js index e56d777ff038b0..0f6556451d013e 100644 --- a/test/parallel/test-tls-keylog-tlsv13.js +++ b/test/parallel/test-tls-keylog-tlsv13.js @@ -9,8 +9,8 @@ const tls = require('tls'); const fixtures = require('../common/fixtures'); const server = tls.createServer({ - key: fixtures.readSync('/keys/agent2-key.pem'), - cert: fixtures.readSync('/keys/agent2-cert.pem'), + key: fixtures.readKey('agent2-key.pem'), + cert: fixtures.readKey('agent2-cert.pem'), // Amount of keylog events depends on negotiated protocol // version, so force a specific one: minVersion: 'TLSv1.3', From 4aea83414848317a6887e566e39113a12287986d Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Thu, 30 May 2019 15:11:32 -0700 Subject: [PATCH 16/17] test: change formatting of fixtures/keys/Makefile Converts the whitespace to spaces in the all: ... target for consistency. The other whitespace has to remain tabs due to how Makefiles work. PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/keys/Makefile | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index ca523f9f20cdd3..8fc3624982fb27 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -24,12 +24,12 @@ all: \ dh512.pem \ dh1024.pem \ dh2048.pem \ - dherror.pem \ - dsa_params.pem \ - dsa_private.pem \ - dsa_private_encrypted.pem \ - dsa_private_pkcs8.pem \ - dsa_public.pem \ + dherror.pem \ + dsa_params.pem \ + dsa_private.pem \ + dsa_private_encrypted.pem \ + dsa_private_pkcs8.pem \ + dsa_public.pem \ dsa1025.pem \ dsa_private_1025.pem \ dsa_private_encrypted_1025.pem \ @@ -37,24 +37,24 @@ all: \ ec-cert.pem \ ec.pfx \ fake-cnnic-root-cert.pem \ - rsa_private.pem \ - rsa_private_encrypted.pem \ - rsa_private_pkcs8.pem \ - rsa_private_pkcs8_bad.pem \ - rsa_public.pem \ - rsa_ca.crt \ - rsa_cert.crt \ - rsa_cert.pfx \ - rsa_public_sha1_signature_signedby_rsa_private.sha1 \ - rsa_public_sha1_signature_signedby_rsa_private_pkcs8.sha1 \ - rsa_private_b.pem \ - I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256 \ - rsa_public_b.pem \ - rsa_cert_foafssl_b.crt \ - rsa_cert_foafssl_b.modulus \ - rsa_cert_foafssl_b.exponent \ - rsa_spkac.spkac \ - rsa_spkac_invalid.spkac \ + rsa_private.pem \ + rsa_private_encrypted.pem \ + rsa_private_pkcs8.pem \ + rsa_private_pkcs8_bad.pem \ + rsa_public.pem \ + rsa_ca.crt \ + rsa_cert.crt \ + rsa_cert.pfx \ + rsa_public_sha1_signature_signedby_rsa_private.sha1 \ + rsa_public_sha1_signature_signedby_rsa_private_pkcs8.sha1 \ + rsa_private_b.pem \ + I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256 \ + rsa_public_b.pem \ + rsa_cert_foafssl_b.crt \ + rsa_cert_foafssl_b.modulus \ + rsa_cert_foafssl_b.exponent \ + rsa_spkac.spkac \ + rsa_spkac_invalid.spkac \ rsa_private_1024.pem \ rsa_private_2048.pem \ rsa_private_4096.pem \ From c5f0551144da5439d65620ca3c963780edb34557 Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Fri, 31 May 2019 17:08:10 -0700 Subject: [PATCH 17/17] test: add comments to the foaf+ssl fixtures PR-URL: #27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/keys/Makefile | 3 +++ test/fixtures/keys/rsa_cert_foafssl_b.cnf | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index 8fc3624982fb27..d953e83c2d6faa 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -651,6 +651,9 @@ I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256: rsa_private_b.pe rsa_public_b.pem: rsa_private_b.pem openssl rsa -in rsa_private_b.pem -pubout -out rsa_public_b.pem +# The following 'foafssl' cert is used in test/parallel/test-https-foafssl.js. +# It requires a SAN like 'http://example.com/#me'. More info here: +# https://www.w3.org/wiki/Foaf+ssl rsa_cert_foafssl_b.crt: rsa_private_b.pem openssl req -new -x509 -config rsa_cert_foafssl_b.cnf -key rsa_private_b.pem -out rsa_cert_foafssl_b.crt diff --git a/test/fixtures/keys/rsa_cert_foafssl_b.cnf b/test/fixtures/keys/rsa_cert_foafssl_b.cnf index 38d6dd36f7bf22..5e69db885a5ab7 100644 --- a/test/fixtures/keys/rsa_cert_foafssl_b.cnf +++ b/test/fixtures/keys/rsa_cert_foafssl_b.cnf @@ -1,3 +1,7 @@ +# The following 'foafssl' cert is used in test/parallel/test-https-foafssl.js. +# It requires a SAN like 'http://example.com/#me'. More info here: +# https://www.w3.org/wiki/Foaf+ssl + [ req ] days = 99999 distinguished_name = req_distinguished_name