Skip to content

Commit fca0693

Browse files
author
James Halliday
committed
fix for smaller keys
1 parent 5755125 commit fca0693

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ module.exports = function (pem) {
1212
var field = {};
1313
var size = {};
1414
var offset = {
15-
private : buf[1] - 0x80 + 5,
16-
public : buf[1] - 0x80 + 2,
15+
private : buf[1] & 0x80 ? buf[1] - 0x80 + 5 : 7,
16+
public : buf[1] & 0x80 ? buf[1] - 0x80 + 2 : 2,
1717
}[type];
1818

1919
function read () {

0 commit comments

Comments
 (0)