nav tabs on admin dashboard
This commit is contained in:
+3
-2
@@ -22,7 +22,8 @@ var AttributeTypeValue = asn.define('AttributeTypeValue', function () {
|
||||
var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {
|
||||
this.seq().obj(
|
||||
this.key('algorithm').objid(),
|
||||
this.key('parameters').optional()
|
||||
this.key('parameters').optional(),
|
||||
this.key('curve').objid().optional()
|
||||
)
|
||||
})
|
||||
|
||||
@@ -64,7 +65,7 @@ var Extension = asn.define('Extension', function () {
|
||||
|
||||
var TBSCertificate = asn.define('TBSCertificate', function () {
|
||||
this.seq().obj(
|
||||
this.key('version').explicit(0).int(),
|
||||
this.key('version').explicit(0).int().optional(),
|
||||
this.key('serialNumber').int(),
|
||||
this.key('signature').use(AlgorithmIdentifier),
|
||||
this.key('issuer').use(Name),
|
||||
|
||||
+5
-4
@@ -1,9 +1,10 @@
|
||||
// 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]+([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 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')
|
||||
var Buffer = require('safe-buffer').Buffer
|
||||
module.exports = function (okey, password) {
|
||||
var key = okey.toString()
|
||||
var match = key.match(findProc)
|
||||
@@ -13,8 +14,8 @@ module.exports = function (okey, password) {
|
||||
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 iv = Buffer.from(match[2], 'hex')
|
||||
var cipherText = Buffer.from(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)
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ var aesid = require('./aesid.json')
|
||||
var fixProc = require('./fixProc')
|
||||
var ciphers = require('browserify-aes')
|
||||
var compat = require('pbkdf2')
|
||||
var Buffer = require('safe-buffer').Buffer
|
||||
module.exports = parseKeys
|
||||
|
||||
function parseKeys (buffer) {
|
||||
@@ -12,7 +13,7 @@ function parseKeys (buffer) {
|
||||
buffer = buffer.key
|
||||
}
|
||||
if (typeof buffer === 'string') {
|
||||
buffer = new Buffer(buffer)
|
||||
buffer = Buffer.from(buffer)
|
||||
}
|
||||
|
||||
var stripped = fixProc(buffer, password)
|
||||
@@ -97,7 +98,7 @@ function decrypt (data, password) {
|
||||
var iv = data.algorithm.decrypt.cipher.iv
|
||||
var cipherText = data.subjectPrivateKey
|
||||
var keylen = parseInt(algo.split('-')[1], 10) / 8
|
||||
var key = compat.pbkdf2Sync(password, salt, iters, keylen)
|
||||
var key = compat.pbkdf2Sync(password, salt, iters, keylen, 'sha1')
|
||||
var cipher = ciphers.createDecipheriv(algo, key, iv)
|
||||
var out = []
|
||||
out.push(cipher.update(cipherText))
|
||||
|
||||
+7
-6
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"_from": "parse-asn1@^5.0.0",
|
||||
"_id": "parse-asn1@5.1.1",
|
||||
"_id": "parse-asn1@5.1.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==",
|
||||
"_integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==",
|
||||
"_location": "/parse-asn1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
@@ -19,8 +19,8 @@
|
||||
"/browserify-sign",
|
||||
"/public-encrypt"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz",
|
||||
"_shasum": "f6bf293818332bd0dab54efb16087724745e6ca8",
|
||||
"_resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz",
|
||||
"_shasum": "37f6628f823fbdeb2273b4d540434a22f3ef1fcc",
|
||||
"_spec": "parse-asn1@^5.0.0",
|
||||
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\browserify-sign",
|
||||
"author": "",
|
||||
@@ -33,7 +33,8 @@
|
||||
"browserify-aes": "^1.0.0",
|
||||
"create-hash": "^1.1.0",
|
||||
"evp_bytestokey": "^1.0.0",
|
||||
"pbkdf2": "^3.0.3"
|
||||
"pbkdf2": "^3.0.3",
|
||||
"safe-buffer": "^5.1.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "utility library for parsing asn1 files for use with browserify-sign.",
|
||||
@@ -54,5 +55,5 @@
|
||||
"test": "npm run standard && npm run unit",
|
||||
"unit": "node ./test"
|
||||
},
|
||||
"version": "5.1.1"
|
||||
"version": "5.1.4"
|
||||
}
|
||||
|
||||
+5
-42
@@ -71,6 +71,10 @@ var cert = {
|
||||
private: fs.readFileSync(__dirname + '/rsa.1024.priv'),
|
||||
public: fs.readFileSync(__dirname + '/node.cert')
|
||||
}
|
||||
var cert2 = {
|
||||
private: fs.readFileSync(__dirname + '/cert.priv'),
|
||||
public: fs.readFileSync(__dirname + '/cert.pub')
|
||||
}
|
||||
var i = 0
|
||||
function testIt (keys) {
|
||||
test('key ' + (++i), function (t) {
|
||||
@@ -80,33 +84,6 @@ 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)
|
||||
@@ -121,18 +98,4 @@ 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)
|
||||
testIt(cert2)
|
||||
|
||||
Reference in New Issue
Block a user