2
1
Fork 0
Dieser Commit ist enthalten in:
AJ ONeal 2018-11-21 19:08:08 -07:00
Ursprung f804728831
Commit 41312c53ac
1 geänderte Dateien mit 0 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -23,13 +23,11 @@ ASN1.parse = function parseAsn1(buf, depth) {
asn1.lengthSize = 0x7f & asn1.length;
// I think that buf->hex->int solves the problem of Endianness... not sure
asn1.length = parseInt(buf.slice(index, index + asn1.lengthSize).toString('hex'), 16);
//index += 1; // add back the original byte indicating lengthSize
index += asn1.lengthSize;
}
// this is a primitive value type
if (-1 !== VTYPES.indexOf(asn1.type)) {
//console.log('t', asn1.type);
asn1.value = buf.slice(index, index + asn1.length);
return asn1;
}
@ -39,7 +37,6 @@ ASN1.parse = function parseAsn1(buf, depth) {
iters += 1;
child = ASN1.parse(buf.slice(index, index + asn1.length), (depth || 0) + 1);
index += (2 + child.lengthSize + child.length);
//console.log('buflen', buf.byteLength, 'index', index);
asn1.children.push(child);
}
if (iters >= 100) { throw new Error(ELOOP); }