sshpk
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -44,4 +44,22 @@ // Copyright 2015 Joyent, Inc. | ||
var headers = {}; | ||
while (true) { | ||
lines = lines.slice(1); | ||
m = lines[0].match(/*JSSTYLED*/ | ||
/^([A-Za-z0-9-]+): (.+)$/); | ||
if (!m) | ||
break; | ||
headers[m[1].toLowerCase()] = m[2]; | ||
} | ||
if (headers['proc-type']) { | ||
var parts = headers['proc-type'].split(','); | ||
if (parts[0] === '4' && parts[1] === 'ENCRYPTED') { | ||
throw (new Error('PEM key is encrypted ' + | ||
'(password-protected). Please use the ' + | ||
'SSH agent or decrypt the key.')); | ||
} | ||
} | ||
/* Chop off the first and last lines */ | ||
lines = lines.slice(1, -2).join(''); | ||
lines = lines.slice(0, -2).join(''); | ||
buf = new Buffer(lines, 'base64'); | ||
@@ -48,0 +66,0 @@ |
{ | ||
"name": "sshpk", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A library for finding and using SSH public keys", | ||
@@ -37,9 +37,9 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"asn1": "^0.2.2", | ||
"assert-plus": "^0.1.5" | ||
"asn1": "0.2.2", | ||
"assert-plus": "0.1.5" | ||
}, | ||
"devDependencies": { | ||
"tape": "^3.5.0", | ||
"benchmark": "^1.0.0" | ||
"tape": ">=3.5.0 <4.0.0", | ||
"benchmark": ">=1.0.0 <2.0.0" | ||
} | ||
} |
@@ -13,3 +13,3 @@ var fs = require('fs'); | ||
var key = sk.Key.parse(keyPem, 'pem', './foo'); | ||
var key = sk.Key.parse(keyPem, 'pem', './foo.pem'); | ||
@@ -16,0 +16,0 @@ console.log('-> using a %d bit %s key', key.size, key.type); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
40366
19
1007
+ Addedasn1@0.2.2(transitive)
- Removedasn1@0.2.6(transitive)
- Removedsafer-buffer@2.1.2(transitive)
Updatedasn1@0.2.2
Updatedassert-plus@0.1.5