summaryrefslogtreecommitdiff
path: root/test/fixtures/keys
diff options
context:
space:
mode:
authorAlex Aubuchon <alex@aub.dev>2019-05-29 15:47:10 -0700
committerAli Ijaz Sheikh <ofrobots@google.com>2019-06-05 11:37:52 -0700
commit7aa79be81cb1613443cc2a8a5ada7ab688194824 (patch)
tree263657e993a3d427c3b399e2ba9b1ca01e86e0f3 /test/fixtures/keys
parentc49e378f9e352933e301aa8b3473a9c468e39fff (diff)
downloadandroid-node-v8-7aa79be81cb1613443cc2a8a5ada7ab688194824.tar.gz
android-node-v8-7aa79be81cb1613443cc2a8a5ada7ab688194824.tar.bz2
android-node-v8-7aa79be81cb1613443cc2a8a5ada7ab688194824.zip
test: move foafssl certs to fixtures/keys/
PR-URL: https://github.com/nodejs/node/pull/27962 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/fixtures/keys')
-rw-r--r--test/fixtures/keys/Makefile14
-rw-r--r--test/fixtures/keys/rsa_cert_foafssl_b.cnf24
-rw-r--r--test/fixtures/keys/rsa_cert_foafssl_b.crt24
-rw-r--r--test/fixtures/keys/rsa_cert_foafssl_b.exponent1
-rw-r--r--test/fixtures/keys/rsa_cert_foafssl_b.modulus1
5 files changed, 64 insertions, 0 deletions
diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile
index 198c8e2bd0..347254f6d9 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 0000000000..38d6dd36f7
--- /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 0000000000..fa4db56c1f
--- /dev/null
+++ b/test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ADAhBgNVHREEGjAYhhZodHRwOi8vZXhhbXBsZS5jb20vI21l
+MA0GCSqGSIb3DQEBCwUAA4IBAQBMRbs4ERIJmZz6GAaI85vbwR166S+g5rkNK8iZ
+jMAeSD9O2/ZT3JhGfh+f/m7cy1+RiARVSZOgd0nN/L6U6JlPbjtK92CpIx+gDw67
+lYV3QQCGU0tNQ1EFNzj6A7Mi/zSZ5wBbTi886xYztLPSjWEHt+8pShHga/Qi3alN
+3haN/UvyamKgmWna8s3zWrCEZwW7D+XQqWoA2EISlnIdX46agHgmU30+TalGDAzf
+OFwGvEfkyHTrrl6TxwdLU8fWsEcBOF6Ukg7kEc1aCBgd3cD9LI8g2N8DQdkWGGEQ
+innpMWv59H2v3gVMj/0/BPGthQMTHMrhKWZZ1QGjkId7tHro
+-----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 0000000000..ac0ecd6975
--- /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 0000000000..7f7f1f02cf
--- /dev/null
+++ b/test/fixtures/keys/rsa_cert_foafssl_b.modulus
@@ -0,0 +1 @@
+C9BD60AEB37EDBD7F179E11B4DA4848DAE932834E94FF5979EAAC5092FA1EC861C9C3A0057072C3D4E4565E50FBCB28CCE2F4D1D2277E0B402BABA87807F17F9CC34613DE07584BFEEAA10897B3ECCABFAD7935CB6D0F7C6540B71E63E370CE7A0F5F2C99C0E799AB25391E2A9BAEABBA85DAFA81062880C34B9F6371056DA919E81DEBE6463025F7FBF06D30FFFAB579ADB588D8FB284DD92AC6CF970A856A5C1E20BA5FE07BB822A8299CBEB768D4C5854A5305ABD59B8CF24A529EE54272FD4EA0C1848A610703BBFF79A17FCBECFF55D43863CF068539D537829BB6067EA3D3E8863C4B154EB655E4C02E2C54E663D029281220229F8DEBF415452EAC5EB