mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-02-28 22:13:33 +00:00
Check length tag in DER-encoded OIDs
This commit is contained in:
@@ -47,6 +47,9 @@ function OID(oid) {
|
||||
util.isUint8Array(oid)) {
|
||||
oid = new Uint8Array(oid);
|
||||
if (oid[0] === 0x06) { // DER encoded oid byte array
|
||||
if (oid[1] !== oid.length - 2) {
|
||||
throw new Error('Length mismatch in DER encoded oid');
|
||||
}
|
||||
oid = oid.subarray(2);
|
||||
}
|
||||
this.oid = oid;
|
||||
|
||||
Reference in New Issue
Block a user