| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
0-dns-cert.pem and 0-dns-key.pem were stored in `test/fixtures/key` directory, but the cert file cannot be created with the openssl command via Makefile. Added a script to create it with using `asn1.js` and `asn1.js-rfc5280` and moved them out of key directory and put into `test/fixtures/0-dns`. The domains listed in the cert were also changed into example.com and example.org to show the use for only testing.
|
CI is running on https://ci.nodejs.org/job/node-test-pull-request/6602/ . |
Sorry, something went wrong.
|
The ci jobs was somehow removed. |
Sorry, something went wrong.
|
|
||
| $ node ./createCert.js | ||
| $ openssl x509 -text -in 0-dns-cert.pem | ||
| (You can not see evel.example.com in subjectAltName field) |
There was a problem hiding this comment.
"evil"?
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed
Sorry, something went wrong.
|
|
||
| const private_key = fs.readFileSync('./0-dns-key.pem'); | ||
| // public key file can be generated from the private key with | ||
| // openssl rsa -in 0-dns-key.pem -RSAPublicKey_out -outform der \ |
There was a problem hiding this comment.
you can wrap to 80 columns, and the backslash isn't necessary at end of line
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed
Sorry, something went wrong.
| const crypto = require('crypto'); | ||
| const rfc5280 = require('asn1.js-rfc5280'); | ||
| const asn1 = require('asn1.js'); | ||
| const BN = asn1.bignum; |
There was a problem hiding this comment.
sort requires
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed
Sorry, something went wrong.
| @@ -0,0 +1,75 @@ | |||
| 'use strict'; | |||
There was a problem hiding this comment.
js files would be named create-cert.js
Sorry, something went wrong.
There was a problem hiding this comment.
Done
Sorry, something went wrong.
| const asn1 = require('asn1.js'); | ||
| const BN = asn1.bignum; | ||
|
|
||
| const id_at_commonName = [ 2, 5, 4, 3 ]; |
There was a problem hiding this comment.
inconsistent casing, sometimes snake_case, sometimes camelCase, it looks like test/fixtures doesn't get linted
Sorry, something went wrong.
There was a problem hiding this comment.
id_at_commonName is named after the ASN.1 notation in RFC5280 which would come from OID name.
Sorry, something went wrong.
| const subject = PrintStr.encode('evil.example.com', 'der'); | ||
|
|
||
| const tbs = | ||
| { version: 'v3', |
There was a problem hiding this comment.
this isn't generally how node indents object literals
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed
Sorry, something went wrong.
|
|
||
| const cert = { | ||
| tbsCertificate: tbs, | ||
| signatureAlgorithm: { algorithm: sha256WithRSAEncryption, parameters: null_}, |
There was a problem hiding this comment.
lacking before closing } here and a couple lines onwards
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed
Sorry, something went wrong.
| const common = require('../common'); | ||
| const assert = require('assert'); | ||
|
|
||
| // check getPeerCertificate can properly handle '\0' for fix CVE-2009-2408 |
There was a problem hiding this comment.
Good to have a test description, it should be a capitalized and period terminated sentence.
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed.
Sorry, something went wrong.
|
Nice use of asn1 to craft the cert. I think the js code should follow the same coding conventions we use elswhere, even though test/fixtures seems to be exempted from linting at the moment. |
Sorry, something went wrong.
|
I made eslint for test/fixtures/0-dns/create-cert.js and only one error of missing common module appeared. $ ./node tools/eslint/bin/eslint.js --rulesdir=tools/eslint-rules test/fixtures/0-dns/create-cert.js --no-ignore
/home/sotsu/github/node/test/fixtures/0-dns/create-cert.js
1:1 error Mandatory module "common" must be loaded required-modules
✖ 1 problem (1 error, 0 warnings)I think it is not necessary for the script in fixtures. |
Sorry, something went wrong.
There was a problem hiding this comment.
Its still a mixture of snake_case and camelCase for vars, but basically LGTM
Sorry, something went wrong.
| Z4CCF58oC4b7MrfFo1LXW8EdSjfK5ejFse6xZe6WNAahi7vDS7RJEyoq3EeZ4+A0 | ||
| DvrSjCuretoVAC/U7gUxs467yM3ZCujqZ4OANVQF6knRziTJEF5c1aXOzM563FT3 | ||
| ufeH36lO0ImzE+a2g6et3BZDL2PQLmBF3F6clQ== | ||
| -----END CERTIFICATE----- No newline at end of file |
There was a problem hiding this comment.
missing newline
Sorry, something went wrong.
There was a problem hiding this comment.
Done
Sorry, something went wrong.
|
camelCase vars are used to follow ASN.1 notation in RFC5289 RFC5280. |
Sorry, something went wrong.
|
@indutny Please take a look of this if you have time for you are the author of asn.1 and asn1.js-rfc5280. |
Sorry, something went wrong.
|
I will land this tomorrow if there are no any comments. |
Sorry, something went wrong.
0-dns-cert.pem and 0-dns-key.pem were stored in `test/fixtures/key` directory, but the cert file cannot be created with the openssl command via Makefile. Added a script to create it with using `asn1.js` and `asn1.js-rfc5280` and moved them out of key directory and put into `test/fixtures/0-dns`. The domains listed in the cert were also changed into example.com and example.org to show the use for only testing. Fixes: #10228 PR-URL: #11579 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
0-dns-cert.pem and 0-dns-key.pem were stored in `test/fixtures/key` directory, but the cert file cannot be created with the openssl command via Makefile. Added a script to create it with using `asn1.js` and `asn1.js-rfc5280` and moved them out of key directory and put into `test/fixtures/0-dns`. The domains listed in the cert were also changed into example.com and example.org to show the use for only testing. Fixes: nodejs#10228 PR-URL: nodejs#11579 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
0-dns-cert.pem and 0-dns-key.pem were stored in `test/fixtures/key` directory, but the cert file cannot be created with the openssl command via Makefile. Added a script to create it with using `asn1.js` and `asn1.js-rfc5280` and moved them out of key directory and put into `test/fixtures/0-dns`. The domains listed in the cert were also changed into example.com and example.org to show the use for only testing. Fixes: nodejs#10228 PR-URL: nodejs#11579 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
0-dns-cert.pem and 0-dns-key.pem were stored in `test/fixtures/key` directory, but the cert file cannot be created with the openssl command via Makefile. Added a script to create it with using `asn1.js` and `asn1.js-rfc5280` and moved them out of key directory and put into `test/fixtures/0-dns`. The domains listed in the cert were also changed into example.com and example.org to show the use for only testing. Fixes: #10228 PR-URL: #11579 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
0-dns-cert.pem and 0-dns-key.pem were stored in `test/fixtures/key` directory, but the cert file cannot be created with the openssl command via Makefile. Added a script to create it with using `asn1.js` and `asn1.js-rfc5280` and moved them out of key directory and put into `test/fixtures/0-dns`. The domains listed in the cert were also changed into example.com and example.org to show the use for only testing. Fixes: #10228 PR-URL: #11579 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
0-dns-cert.pem and 0-dns-key.pem were stored in `test/fixtures/key` directory, but the cert file cannot be created with the openssl command via Makefile. Added a script to create it with using `asn1.js` and `asn1.js-rfc5280` and moved them out of key directory and put into `test/fixtures/0-dns`. The domains listed in the cert were also changed into example.com and example.org to show the use for only testing. Fixes: nodejs/node#10228 PR-URL: nodejs/node#11579 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
| Back | FazBrowse Home | New Git URL |
0-dns-cert.pem and 0-dns-key.pem were stored in test/fixtures/key
directory, but the cert file cannot be created with the openssl
command via Makefile. make clean removes them but we could not re-create them.
This added a script to create it with using asn1.js and
asn1.js-rfc5280 and moved them out of key directory and put into
test/fixtures/0-dns.
The domains listed in the cert were also changed into example.com and
example.org to show the use for only testing.
Checklist
Affected core subsystem(s)
test, tls
R: @indutny