| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,6 +50,9 @@ all: \ | |||
| 50 | 50 | rsa_private_b.pem \ | |
| 51 | 51 | I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256 \ | |
| 52 | 52 | rsa_public_b.pem \ | |
| 53 | + rsa_cert_foafssl_b.crt \ | ||
| 54 | + rsa_cert_foafssl_b.modulus \ | ||
| 55 | + rsa_cert_foafssl_b.exponent \ | ||
| 53 | 56 | rsa_spkac.spkac \ | |
| 54 | 57 | rsa_spkac_invalid.spkac \ | |
| 55 | 58 | rsa_private_1024.pem \ | |
@@ -648,6 +651,17 @@ I_AM_THE_WALRUS_sha256_signature_signedby_rsa_private_b.sha256: rsa_private_b.pe | |||
| 648 | 651 | rsa_public_b.pem: rsa_private_b.pem | |
| 649 | 652 | openssl rsa -in rsa_private_b.pem -pubout -out rsa_public_b.pem | |
| 650 | 653 | ||
| 654 | + rsa_cert_foafssl_b.crt: rsa_private_b.pem | ||
| 655 | + openssl req -new -x509 -config rsa_cert_foafssl_b.cnf -key rsa_private_b.pem -out rsa_cert_foafssl_b.crt | ||
| 656 | + | ||
| 657 | + # The 'modulus=' in the output must be stripped out | ||
| 658 | + rsa_cert_foafssl_b.modulus: rsa_cert_foafssl_b.crt | ||
| 659 | + openssl x509 -modulus -in rsa_cert_foafssl_b.crt -noout | cut -c 9- > rsa_cert_foafssl_b.modulus | ||
| 660 | + | ||
| 661 | + # Have to parse out the hex exponent | ||
| 662 | + rsa_cert_foafssl_b.exponent: rsa_cert_foafssl_b.crt | ||
| 663 | + openssl x509 -in rsa_cert_foafssl_b.crt -text | grep -o 'Exponent:.*' | sed 's/\(.*(\|).*\)//g' > rsa_cert_foafssl_b.exponent | ||
| 664 | + | ||
| 651 | 665 | # openssl outputs `SPKAC=[SPKAC]`. That prefix needs to be removed to work with node | |
| 652 | 666 | rsa_spkac.spkac: rsa_private.pem | |
| 653 | 667 | openssl spkac -key rsa_private.pem -challenge this-is-a-challenge | cut -c 7- > rsa_spkac.spkac | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,24 @@ | |||
| 1 | + [ req ] | ||
| 2 | + days = 99999 | ||
| 3 | + distinguished_name = req_distinguished_name | ||
| 4 | + attributes = req_attributes | ||
| 5 | + prompt = no | ||
| 6 | + x509_extensions = v3_ca | ||
| 7 | + | ||
| 8 | + [ req_distinguished_name ] | ||
| 9 | + C = UK | ||
| 10 | + ST = "FOAF+SSL Auth Certificate" | ||
| 11 | + L = Rhys Jones | ||
| 12 | + O = node.js | ||
| 13 | + OU = Test TLS Certificate | ||
| 14 | + CN = localhost | ||
| 15 | + emailAddress = alex@aub.dev | ||
| 16 | + | ||
| 17 | + [ req_attributes ] | ||
| 18 | + | ||
| 19 | + [ v3_ca ] | ||
| 20 | + basicConstraints = CA:FALSE | ||
| 21 | + subjectAltName = @alt_names | ||
| 22 | + | ||
| 23 | + [ alt_names ] | ||
| 24 | + URI = http://example.com/\#me | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,24 @@ | |||
| 1 | + -----BEGIN CERTIFICATE----- | ||
| 2 | + MIIEEDCCAvigAwIBAgIUAhzZrkGH3j4aXirSjA6n87moF9kwDQYJKoZIhvcNAQEL | ||
| 3 | + BQAwgagxCzAJBgNVBAYTAlVLMSIwIAYDVQQIDBlGT0FGK1NTTCBBdXRoIENlcnRp | ||
| 4 | + ZmljYXRlMRMwEQYDVQQHDApSaHlzIEpvbmVzMRAwDgYDVQQKDAdub2RlLmpzMR0w | ||
| 5 | + GwYDVQQLDBRUZXN0IFRMUyBDZXJ0aWZpY2F0ZTESMBAGA1UEAwwJbG9jYWxob3N0 | ||
| 6 | + MRswGQYJKoZIhvcNAQkBFgxhbGV4QGF1Yi5kZXYwHhcNMTkwNTI5MjIzMjM1WhcN | ||
| 7 | + MTkwNjI4MjIzMjM1WjCBqDELMAkGA1UEBhMCVUsxIjAgBgNVBAgMGUZPQUYrU1NM | ||
| 8 | + IEF1dGggQ2VydGlmaWNhdGUxEzARBgNVBAcMClJoeXMgSm9uZXMxEDAOBgNVBAoM | ||
| 9 | + B25vZGUuanMxHTAbBgNVBAsMFFRlc3QgVExTIENlcnRpZmljYXRlMRIwEAYDVQQD | ||
| 10 | + DAlsb2NhbGhvc3QxGzAZBgkqhkiG9w0BCQEWDGFsZXhAYXViLmRldjCCASIwDQYJ | ||
| 11 | + KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMm9YK6zftvX8XnhG02khI2ukyg06U/1 | ||
| 12 | + l56qxQkvoeyGHJw6AFcHLD1ORWXlD7yyjM4vTR0id+C0Arq6h4B/F/nMNGE94HWE | ||
| 13 | + v+6qEIl7Psyr+teTXLbQ98ZUC3HmPjcM56D18smcDnmaslOR4qm66ruoXa+oEGKI | ||
| 14 | + DDS59jcQVtqRnoHevmRjAl9/vwbTD/+rV5rbWI2PsoTdkqxs+XCoVqXB4gul/ge7 | ||
| 15 | + giqCmcvrdo1MWFSlMFq9WbjPJKUp7lQnL9TqDBhIphBwO7/3mhf8vs/1XUOGPPBo | ||
| 16 | + U51TeCm7YGfqPT6IY8SxVOtlXkwC4sVOZj0CkoEiAin43r9BVFLqxesCAwEAAaMw | ||
| 17 | + MC4wCQYDVR0TBAIwADAhBgNVHREEGjAYhhZodHRwOi8vZXhhbXBsZS5jb20vI21l | ||
| 18 | + MA0GCSqGSIb3DQEBCwUAA4IBAQBMRbs4ERIJmZz6GAaI85vbwR166S+g5rkNK8iZ | ||
| 19 | + jMAeSD9O2/ZT3JhGfh+f/m7cy1+RiARVSZOgd0nN/L6U6JlPbjtK92CpIx+gDw67 | ||
| 20 | + lYV3QQCGU0tNQ1EFNzj6A7Mi/zSZ5wBbTi886xYztLPSjWEHt+8pShHga/Qi3alN | ||
| 21 | + 3haN/UvyamKgmWna8s3zWrCEZwW7D+XQqWoA2EISlnIdX46agHgmU30+TalGDAzf | ||
| 22 | + OFwGvEfkyHTrrl6TxwdLU8fWsEcBOF6Ukg7kEc1aCBgd3cD9LI8g2N8DQdkWGGEQ | ||
| 23 | + innpMWv59H2v3gVMj/0/BPGthQMTHMrhKWZZ1QGjkId7tHro | ||
| 24 | + -----END CERTIFICATE----- | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + 0x10001 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + C9BD60AEB37EDBD7F179E11B4DA4848DAE932834E94FF5979EAAC5092FA1EC861C9C3A0057072C3D4E4565E50FBCB28CCE2F4D1D2277E0B402BABA87807F17F9CC34613DE07584BFEEAA10897B3ECCABFAD7935CB6D0F7C6540B71E63E370CE7A0F5F2C99C0E799AB25391E2A9BAEABBA85DAFA81062880C34B9F6371056DA919E81DEBE6463025F7FBF06D30FFFAB579ADB588D8FB284DD92AC6CF970A856A5C1E20BA5FE07BB822A8299CBEB768D4C5854A5305ABD59B8CF24A529EE54272FD4EA0C1848A610703BBFF79A17FCBECFF55D43863CF068539D537829BB6067EA3D3E8863C4B154EB655E4C02E2C54E663D029281220229F8DEBF415452EAC5EB | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,21 +33,15 @@ const https = require('https'); | |||
| 33 | 33 | const spawn = require('child_process').spawn; | |
| 34 | 34 | ||
| 35 | 35 | const options = { | |
| 36 | - key: fixtures.readSync('agent.key'), | ||
| 37 | - cert: fixtures.readSync('agent.crt'), | ||
| 36 | + key: fixtures.readKey('rsa_private.pem'), | ||
| 37 | + cert: fixtures.readKey('rsa_cert.crt'), | ||
| 38 | 38 | requestCert: true, | |
| 39 | 39 | rejectUnauthorized: false | |
| 40 | 40 | }; | |
| 41 | 41 | ||
| 42 | - const modulus = 'A6F44A9C25791431214F5C87AF9E040177A8BB89AC803F7E09BBC3A5519F' + | ||
| 43 | - '349CD9B9C40BE436D0AA823A94147E26C89248ADA2BE3DD4D34E8C289646' + | ||
| 44 | - '94B2047D217B4F1299371EA93A83C89AB9440724131E65F2B0161DE9560C' + | ||
| 45 | - 'DE9C13455552B2F49CF0FB00D8D77532324913F6F80FF29D0A131D29DB06' + | ||
| 46 | - 'AFF8BE191B7920DC2DAE1C26EA82A47847A10391EF3BF6AABB3CC40FF821' + | ||
| 47 | - '00B03A4F0FF1809278E4DDFDA7DE954ED56DC7AD9A47EEBC37D771A366FC' + | ||
| 48 | - '60A5BCB72373BEC180649B3EFA0E9092707210B41B90032BB18BC91F2046' + | ||
| 49 | - 'EBDAF1191F4A4E26D71879C4C7867B62FCD508E8CE66E82D128A71E91580' + | ||
| 50 | - '9FCF44E8DE774067F1DE5D70B9C03687'; | ||
| 42 | + const webIdUrl = 'URI:http://example.com/#me'; | ||
| 43 | + const modulus = fixtures.readKey('rsa_cert_foafssl_b.modulus', 'ascii').replace(/\n/g, ''); | ||
| 44 | + const exponent = fixtures.readKey('rsa_cert_foafssl_b.exponent', 'ascii').replace(/\n/g, ''); | ||
| 51 | 45 | ||
| 52 | 46 | const CRLF = '\r\n'; | |
| 53 | 47 | const body = 'hello world\n'; | |
@@ -58,8 +52,8 @@ const server = https.createServer(options, common.mustCall(function(req, res) { | |||
| 58 | 52 | ||
| 59 | 53 | cert = req.connection.getPeerCertificate(); | |
| 60 | 54 | ||
| 61 | - assert.strictEqual(cert.subjectaltname, 'URI:http://example.com/#me'); | ||
| 62 | - assert.strictEqual(cert.exponent, '0x10001'); | ||
| 55 | + assert.strictEqual(cert.subjectaltname, webIdUrl); | ||
| 56 | + assert.strictEqual(cert.exponent, exponent); | ||
| 63 | 57 | assert.strictEqual(cert.modulus, modulus); | |
| 64 | 58 | res.writeHead(200, { 'content-type': 'text/plain' }); | |
| 65 | 59 | res.end(body); | |
@@ -69,8 +63,8 @@ server.listen(0, function() { | |||
| 69 | 63 | const args = ['s_client', | |
| 70 | 64 | '-quiet', | |
| 71 | 65 | '-connect', `127.0.0.1:${this.address().port}`, | |
| 72 | - '-cert', fixtures.path('foafssl.crt'), | ||
| 73 | - '-key', fixtures.path('foafssl.key')]; | ||
| 66 | + '-cert', fixtures.path('keys/rsa_cert_foafssl_b.crt'), | ||
| 67 | + '-key', fixtures.path('keys/rsa_private_b.pem')]; | ||
| 74 | 68 | ||
| 75 | 69 | const client = spawn(common.opensslCli, args); | |
| 76 | 70 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments