aboutsummaryrefslogtreecommitdiff
path: root/node_modules/parse-asn1
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
commitbbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch)
treec58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/parse-asn1
parent003fb34971cf63466184351b4db5f7c67df4f444 (diff)
downloadwallet-core-bbff7403fbf46f9ad92240ac213df8d30ef31b64.tar.xz
update packages
Diffstat (limited to 'node_modules/parse-asn1')
-rw-r--r--node_modules/parse-asn1/.npmignore1
-rw-r--r--node_modules/parse-asn1/README.md2
-rw-r--r--node_modules/parse-asn1/fixProc.js10
-rw-r--r--node_modules/parse-asn1/package.json2
-rw-r--r--node_modules/parse-asn1/test/index.js42
5 files changed, 49 insertions, 8 deletions
diff --git a/node_modules/parse-asn1/.npmignore b/node_modules/parse-asn1/.npmignore
deleted file mode 100644
index 4ebc8aea5..000000000
--- a/node_modules/parse-asn1/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-coverage
diff --git a/node_modules/parse-asn1/README.md b/node_modules/parse-asn1/README.md
index 89ed07461..9cd4c153e 100644
--- a/node_modules/parse-asn1/README.md
+++ b/node_modules/parse-asn1/README.md
@@ -1,4 +1,4 @@
-#parse-asn1
+# parse-asn1
[![TRAVIS](https://secure.travis-ci.org/crypto-browserify/parse-asn1.png)](http://travis-ci.org/crypto-browserify/parse-asn1)
[![NPM](http://img.shields.io/npm/v/parse-asn1.svg)](https://www.npmjs.org/package/parse-asn1)
diff --git a/node_modules/parse-asn1/fixProc.js b/node_modules/parse-asn1/fixProc.js
index 655c3cf2e..b50042ab0 100644
--- a/node_modules/parse-asn1/fixProc.js
+++ b/node_modules/parse-asn1/fixProc.js
@@ -1,7 +1,7 @@
// adapted from https://github.com/apatil/pemstrip
-var findProc = /Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m
-var startRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m
-var fullRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m
+var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m
+var startRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m
+var fullRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m
var evp = require('evp_bytestokey')
var ciphers = require('browserify-aes')
module.exports = function (okey, password) {
@@ -10,11 +10,11 @@ module.exports = function (okey, password) {
var decrypted
if (!match) {
var match2 = key.match(fullRegex)
- decrypted = new Buffer(match2[2].replace(/\r?\n/g, ''), 'base64')
+ decrypted = new Buffer(match2[2].replace(/[\r\n]/g, ''), 'base64')
} else {
var suite = 'aes' + match[1]
var iv = new Buffer(match[2], 'hex')
- var cipherText = new Buffer(match[3].replace(/\r?\n/g, ''), 'base64')
+ var cipherText = new Buffer(match[3].replace(/[\r\n]/g, ''), 'base64')
var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key
var out = []
var cipher = ciphers.createDecipheriv(suite, cipherKey, iv)
diff --git a/node_modules/parse-asn1/package.json b/node_modules/parse-asn1/package.json
index b1891f62b..2a6869b51 100644
--- a/node_modules/parse-asn1/package.json
+++ b/node_modules/parse-asn1/package.json
@@ -1,6 +1,6 @@
{
"name": "parse-asn1",
- "version": "5.1.0",
+ "version": "5.1.1",
"description": "utility library for parsing asn1 files for use with browserify-sign.",
"main": "index.js",
"scripts": {
diff --git a/node_modules/parse-asn1/test/index.js b/node_modules/parse-asn1/test/index.js
index d8bf70d47..85cb0ab4b 100644
--- a/node_modules/parse-asn1/test/index.js
+++ b/node_modules/parse-asn1/test/index.js
@@ -80,6 +80,33 @@ function testIt (keys) {
})
}
+function testEOL (keys) {
+ var publicKey = keys.public.toString()
+ var newLineRegex = /\r?\n/g
+ var genPrivate = function (replace) {
+ if (keys.private.key) {
+ return { key: keys.private.key.toString().replace(newLineRegex, replace), passphrase: keys.private.passphrase }
+ } else {
+ return keys.private.toString().replace(newLineRegex, replace)
+ }
+ }
+ var testN = {
+ private: genPrivate('\n'),
+ public: publicKey.replace(newLineRegex, '\n')
+ }
+ testIt(testN)
+ var testR = {
+ private: genPrivate('\r'),
+ public: publicKey.replace(newLineRegex, '\r')
+ }
+ testIt(testR)
+ var testRN = {
+ private: genPrivate('\r\n'),
+ public: publicKey.replace(newLineRegex, '\r\n')
+ }
+ testIt(testRN)
+}
+
testIt(dsa)
testIt(dsa2)
testIt(rsa1024)
@@ -94,3 +121,18 @@ testIt(rsapass2)
testIt(pass1024)
testIt(pass1024)
testIt(cert)
+
+testEOL(dsa)
+testEOL(dsa2)
+testEOL(rsa1024)
+testEOL(ec)
+testEOL(rsa2028)
+testEOL(nonrsa1024)
+testEOL(ecpass)
+testEOL(dsapass)
+testEOL(dsapass2)
+testEOL(rsapass)
+testEOL(rsapass2)
+testEOL(pass1024)
+testEOL(pass1024)
+testEOL(cert)