sshpk
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -71,3 +71,9 @@ // Copyright 2015 Joyent, Inc. | ||
alg = parts[0].toLowerCase(); | ||
hash = new Buffer(parts[1], 'base64'); | ||
if (!/^[A-Za-z0-9+\/=]+$/.test(parts[1])) | ||
throw (new FingerprintFormatError(fp)); | ||
try { | ||
hash = new Buffer(parts[1], 'base64'); | ||
} catch (e) { | ||
throw (new FingerprintFormatError(fp)); | ||
} | ||
} else if (parts.length > 2) { | ||
@@ -80,3 +86,7 @@ alg = 'md5'; | ||
throw (new FingerprintFormatError(fp)); | ||
hash = new Buffer(parts, 'hex'); | ||
try { | ||
hash = new Buffer(parts, 'hex'); | ||
} catch (e) { | ||
throw (new FingerprintFormatError(fp)); | ||
} | ||
} | ||
@@ -83,0 +93,0 @@ |
{ | ||
"name": "sshpk", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A library for finding and using SSH public keys", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
40597
1017