Skip to content

Commit

Permalink
Merge branch 'main' into bdehamer/signature-content-sig
Browse files Browse the repository at this point in the history
  • Loading branch information
bdehamer authored Jan 3, 2024
2 parents df5e7d6 + 922a1be commit 2edd99f
Show file tree
Hide file tree
Showing 9 changed files with 171 additions and 270 deletions.
5 changes: 5 additions & 0 deletions .changeset/spicy-kiwis-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sigstore/mock": patch
---

Bump jose from 5.1.3 to 5.2.0
5 changes: 5 additions & 0 deletions .changeset/tasty-years-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sigstore/cli": patch
---

Bump openid-client from 5.6.1 to 5.6.2
5 changes: 5 additions & 0 deletions .changeset/tough-adults-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sigstore/core": patch
---

Ensure the `isCA` value for the `X509BasicConstraintsExtension` defaults to `false` if no other value is present
399 changes: 135 additions & 264 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"@total-typescript/shoehorn": "^0.1.1",
"@tsconfig/node16": "^16.1.1",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.5",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"@types/node": "^20.10.6",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@oclif/core": "^3",
"@oclif/plugin-help": "^6",
"open": "^8.4.2",
"openid-client": "^5.6.1",
"openid-client": "^5.6.2",
"sigstore": "^2.1.0"
},
"devDependencies": {
Expand Down
15 changes: 15 additions & 0 deletions packages/core/src/__tests__/x509/ext.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,21 @@ describe('x509BasicConstraintsExtension', () => {
expect(subject.isCA).toBe(true);
});
});

describe('when the extension contains no value for the CA', () => {
// Extension w/ NO isCA value specified
const basicConstraintsExtension = Buffer.from(
'300C0603551D130101FF04023000',
'hex'
);
const subject = new X509BasicConstraintsExtension(
ASN1Obj.parseBuffer(basicConstraintsExtension)
);

it('returns false', () => {
expect(subject.isCA).toBe(false);
});
});
});

describe('#pathLenConstraint', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/x509/ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class X509Extension {
// https://www.rfc-editor.org/rfc/rfc5280#section-4.2.1.9
export class X509BasicConstraintsExtension extends X509Extension {
get isCA(): boolean {
return this.sequence.subs[0].toBoolean();
return this.sequence.subs[0]?.toBoolean() ?? false;
}

get pathLenConstraint(): bigint | undefined {
Expand Down
2 changes: 1 addition & 1 deletion packages/mock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"asn1js": "^3.0.5",
"bytestreamjs": "^2.0.1",
"canonicalize": "^2.0.0",
"jose": "^5.1.3",
"jose": "^5.2.0",
"nock": "^13.4.0",
"pkijs": "^3.0.15",
"pvutils": "^1.1.3"
Expand Down

0 comments on commit 2edd99f

Please sign in to comment.