Skip to content

Commit

Permalink
updaet node-forge to fix critical vulnerability. fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Reinstein committed Sep 18, 2020
1 parent 1823e64 commit 4a04be3
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 67 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"author": "Mike Reinstein",
"license": "MIT",
"dependencies": {
"node-forge": "^0.7.0",
"node-forge": "^0.10.0",
"validator": "^9.0.0"
},
"devDependencies": {
Expand Down
64 changes: 0 additions & 64 deletions test/cert-latest.pem

This file was deleted.

110 changes: 110 additions & 0 deletions test/echo-api-cert-8.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
-----BEGIN CERTIFICATE-----
MIIFbjCCBFagAwIBAgIQBRsSsK9/f9dI7rlZGtPo3TANBgkqhkiG9w0BAQsFADBG
MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRUwEwYDVQQLEwxTZXJ2ZXIg
Q0EgMUIxDzANBgNVBAMTBkFtYXpvbjAeFw0yMDAzMTkwMDAwMDBaFw0yMTAzMTAx
MjAwMDBaMB4xHDAaBgNVBAMTE2VjaG8tYXBpLmFtYXpvbi5jb20wggEiMA0GCSqG
SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCmd8SQClJ92SBjL2Q3G1MxQ4QEnTVE7qA3
QhsAphIe1FHkSt4IVODhugprFNecdYppWSGy0Bzl7kn0KGer4NE6TJ3KV/Ux4jzw
M1aXhq3JmQcOA7DFO+EqdjhcwSoVmZJF32M7X0M2AdR3HZB9s/dk8MDpEPewtT4/
2V0CsbEsA9sgKnzVZUdbL3SETLPJyh/+8N84fm32mjkrQdFPVqGWK9fp1tYwE+3M
5X6ZiiCXJsnyewnxOFm1upiNbX/6hJtMJch9kpIfQzz8eKHt9jtLpsM5m04pV/t8
SmQlQ+rnnH/JrDN5HJ86D6nAW3o8UcILwGTDnsre18OJ3AbFx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AYYwHQYDVR0O
BBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMB8GA1UdIwQYMBaAFL9ft9HO3R+G9FtV
rNzXEMIOqYjnME8GCCsGAQUFBwEBBEMwQTAcBggrBgEFBQcwAYYQaHR0cDovL28u
c3MyLnVzLzAhBggrBgEFBQcwAoYVaHR0cDovL3guc3MyLnVzL3guY2VyMCYGA1Ud
HwQfMB0wG6AZoBeGFWh0dHA6Ly9zLnNzMi51cy9yLmNybDARBgNVHSAECjAIMAYG
BFUdIAAwDQYJKoZIhvcNAQELBQADggEBACMd44pXyn3pF3lM8R5V/cxTbj5HD9/G
VfKyBDbtgB9TxF00KGu+x1X8Z+rLP3+QsjPNG1gQggL4+C/1E2DUBc7xgQjB3ad1
l08YuW3e95ORCLp+QCztweq7dp4zBncdDQh/U90bZKuCJ/Fp1U1ervShw3WnWEQt
8jxwmKy6abaVd38PMV4s/KCHOkdp8Hlf9BRUpJVeEXgSYCfOn8J3/yNTd126/+pZ
59vPr5KW7ySaNRB6nJHGDn2Z9j8Z3/VyVOEVqQdZe4O/Ui5GjLIAZHYcSNPYeehu
VsyuLAOQ1xk4meTKCRlb/weWsKh/NEnfVqn3sF/tM+2MR7cwA130A4w=
-----END CERTIFICATE-----
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var verifier = require('../')
var sinon = require('sinon')


var cert_url = 'https://s3.amazonaws.com/echo.api/echo-api-cert-5.pem' // latest valid cert
var cert_url = 'https://s3.amazonaws.com/echo.api/echo-api-cert-8.pem' // latest valid cert

test('handle missing cert_url parameter', function (t) {
var body, now, signature
Expand Down
2 changes: 1 addition & 1 deletion test/validate-cert.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ test('fails on expired certificate (Not After)', function (t) {
})

test('approves valid certifcate', function (t) {
var pem = fs.readFileSync(__dirname + '/cert-latest.pem')
var pem = fs.readFileSync(__dirname + '/echo-api-cert-8.pem')
t.assert(validate(pem) === undefined, 'Certificate should be valid')
t.end()
})

0 comments on commit 4a04be3

Please sign in to comment.