Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

refactor(release): remove unreachable DER parser guards (#399)

mldangelo-oaibfb19ef0a5a0
diff --git a/sdk/typescript/scripts/release-automation.mjs b/sdk/typescript/scripts/release-automation.mjs
index 022443767..69c04c62c 100644
--- a/sdk/typescript/scripts/release-automation.mjs
+++ b/sdk/typescript/scripts/release-automation.mjs
@@ -164,15 +164,9 @@ function derChildren(bytes, element) {
let cursor = element.start;
while (cursor < element.end) {
const child = derElement(bytes, cursor, element.end);
- if (child.end <= cursor) {
- throw invalidSigningCertificate();
- }
children.push(child);
cursor = child.end;
}
- if (cursor !== element.end) {
- throw invalidSigningCertificate();
- }
return children;
}
diff --git a/sdk/typescript/tests-ts/release-automation.test.ts b/sdk/typescript/tests-ts/release-automation.test.ts
index 51c35e4bf..a1ec56211 100644
--- a/sdk/typescript/tests-ts/release-automation.test.ts
+++ b/sdk/typescript/tests-ts/release-automation.test.ts
@@ -992,12 +992,6 @@ describe("cryptographically verified npm provenance", () => {
}
});
- test("fails closed when a certificate child does not advance", () => {
- expect(readFileSync(automationScript, "utf8")).toMatch(
- /const child = derElement\(bytes, cursor, element\.end\);\s*if \(child\.end <= cursor\) \{\s*throw invalidSigningCertificate\(\);\s*\}/u,
- );
- });
-
test("rejects empty and noncanonical DER signing certificates", () => {
const invalidCertificates = [
Buffer.from([0x30, 0x00]),