Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions node_modules/@sigstore/tuf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sigstore/tuf",
"version": "3.1.0",
"version": "3.1.1",
"description": "Client for the Sigstore TUF repository",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -32,7 +32,7 @@
"@types/make-fetch-happen": "^10.0.4"
},
"dependencies": {
"@sigstore/protobuf-specs": "^0.4.0",
"@sigstore/protobuf-specs": "^0.4.1",
"tuf-js": "^3.0.1"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion node_modules/@sigstore/tuf/seeds.json

Large diffs are not rendered by default.

18 changes: 12 additions & 6 deletions node_modules/@sigstore/verify/dist/key/certificate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ exports.CertificateChainVerifier = void 0;
exports.verifyCertificateChain = verifyCertificateChain;
const error_1 = require("../error");
const trust_1 = require("../trust");
function verifyCertificateChain(leaf, certificateAuthorities) {
function verifyCertificateChain(timestamp, leaf, certificateAuthorities) {
// Filter list of trusted CAs to those which are valid for the given
// leaf certificate.
const cas = (0, trust_1.filterCertAuthorities)(certificateAuthorities, {
start: leaf.notBefore,
end: leaf.notAfter,
});
// timestamp
const cas = (0, trust_1.filterCertAuthorities)(certificateAuthorities, timestamp);
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
let error;
for (const ca of cas) {
try {
const verifier = new CertificateChainVerifier({
trustedCerts: ca.certChain,
untrustedCert: leaf,
timestamp,
});
return verifier.verify();
}
Expand All @@ -41,12 +39,20 @@ class CertificateChainVerifier {
...opts.trustedCerts,
opts.untrustedCert,
]);
this.timestamp = opts.timestamp;
}
verify() {
// Construct certificate path from leaf to root
const certificatePath = this.sort();
// Perform validation checks on each certificate in the path
this.checkPath(certificatePath);
const validForDate = certificatePath.every((cert) => cert.validForDate(this.timestamp));
if (!validForDate) {
throw new error_1.VerificationError({
code: 'CERTIFICATE_ERROR',
message: 'certificate is not valid or expired at the specified date',
});
}
// Return verified certificate path
return certificatePath;
}
Expand Down
13 changes: 4 additions & 9 deletions node_modules/@sigstore/verify/dist/key/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,10 @@ function verifyPublicKey(hint, timestamps, trustMaterial) {
}
function verifyCertificate(leaf, timestamps, trustMaterial) {
// Check that leaf certificate chains to a trusted CA
const path = (0, certificate_1.verifyCertificateChain)(leaf, trustMaterial.certificateAuthorities);
// Check that ALL certificates are valid for ALL of the timestamps
const validForDate = timestamps.every((timestamp) => path.every((cert) => cert.validForDate(timestamp)));
if (!validForDate) {
throw new error_1.VerificationError({
code: 'CERTIFICATE_ERROR',
message: 'certificate is not valid or expired at the specified date',
});
}
let path = [];
timestamps.forEach((timestamp) => {
path = (0, certificate_1.verifyCertificateChain)(timestamp, leaf, trustMaterial.certificateAuthorities);
});
return {
scts: (0, sct_1.verifySCTs)(path[0], path[1], trustMaterial.ctlogs),
signer: getSigner(path[0]),
Expand Down
14 changes: 2 additions & 12 deletions node_modules/@sigstore/verify/dist/timestamp/tsa.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ const trust_1 = require("../trust");
function verifyRFC3161Timestamp(timestamp, data, timestampAuthorities) {
const signingTime = timestamp.signingTime;
// Filter for CAs which were valid at the time of signing
timestampAuthorities = (0, trust_1.filterCertAuthorities)(timestampAuthorities, {
start: signingTime,
end: signingTime,
});
timestampAuthorities = (0, trust_1.filterCertAuthorities)(timestampAuthorities, signingTime);
// Filter for CAs which match serial and issuer embedded in the timestamp
timestampAuthorities = filterCAsBySerialAndIssuer(timestampAuthorities, {
serialNumber: timestamp.signerSerialNumber,
Expand Down Expand Up @@ -44,6 +41,7 @@ function verifyTimestampForCA(timestamp, data, ca) {
new certificate_1.CertificateChainVerifier({
untrustedCert: leaf,
trustedCerts: cas,
timestamp: signingTime,
}).verify();
}
catch (e) {
Expand All @@ -52,14 +50,6 @@ function verifyTimestampForCA(timestamp, data, ca) {
message: 'invalid certificate chain',
});
}
// Check that all of the CA certs were valid at the time of signing
const validAtSigningTime = ca.certChain.every((cert) => cert.validForDate(signingTime));
if (!validAtSigningTime) {
throw new error_1.VerificationError({
code: 'TIMESTAMP_ERROR',
message: 'timestamp was signed with an expired certificate',
});
}
// Check that the signing certificate's key can be used to verify the
// timestamp signature.
timestamp.verify(data, signingKey);
Expand Down
4 changes: 2 additions & 2 deletions node_modules/@sigstore/verify/dist/trust/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.filterCertAuthorities = filterCertAuthorities;
exports.filterTLogAuthorities = filterTLogAuthorities;
function filterCertAuthorities(certAuthorities, criteria) {
function filterCertAuthorities(certAuthorities, timestamp) {
return certAuthorities.filter((ca) => {
return (ca.validFor.start <= criteria.start && ca.validFor.end >= criteria.end);
return ca.validFor.start <= timestamp && ca.validFor.end >= timestamp;
});
}
// Filter the list of tlog instances to only those which match the given log
Expand Down
4 changes: 2 additions & 2 deletions node_modules/@sigstore/verify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sigstore/verify",
"version": "2.1.0",
"version": "2.1.1",
"description": "Verification of Sigstore signatures",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -26,7 +26,7 @@
"provenance": true
},
"dependencies": {
"@sigstore/protobuf-specs": "^0.4.0",
"@sigstore/protobuf-specs": "^0.4.1",
"@sigstore/bundle": "^3.1.0",
"@sigstore/core": "^2.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions node_modules/binary-extensions/binary-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"cmx",
"cpio",
"cr2",
"cr3",
"cur",
"dat",
"dcm",
Expand Down
2 changes: 1 addition & 1 deletion node_modules/binary-extensions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "binary-extensions",
"version": "3.0.0",
"version": "3.1.0",
"description": "List of binary file extensions",
"license": "MIT",
"repository": "sindresorhus/binary-extensions",
Expand Down
Loading
Loading