Skip to content

Commit f36dc59

Browse files
committed
1 parent 7ee15bb commit f36dc59

File tree

233 files changed

+488
-17313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+488
-17313
lines changed

node_modules/.gitignore

-35
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,6 @@
3838
!/@sigstore/core
3939
!/@sigstore/protobuf-specs
4040
!/@sigstore/sign
41-
!/@sigstore/sign/node_modules/
42-
/@sigstore/sign/node_modules/*
43-
!/@sigstore/sign/node_modules/@npmcli/
44-
/@sigstore/sign/node_modules/@npmcli/*
45-
!/@sigstore/sign/node_modules/@npmcli/agent
46-
!/@sigstore/sign/node_modules/@npmcli/fs
47-
!/@sigstore/sign/node_modules/cacache
48-
!/@sigstore/sign/node_modules/make-fetch-happen
49-
!/@sigstore/sign/node_modules/minipass-fetch
50-
!/@sigstore/sign/node_modules/proc-log
51-
!/@sigstore/sign/node_modules/ssri
52-
!/@sigstore/sign/node_modules/unique-filename
53-
!/@sigstore/sign/node_modules/unique-slug
5441
!/@sigstore/tuf
5542
!/@sigstore/verify
5643
!/@tufjs/
@@ -222,23 +209,6 @@
222209
!/shebang-regex
223210
!/signal-exit
224211
!/sigstore
225-
!/sigstore/node_modules/
226-
/sigstore/node_modules/*
227-
!/sigstore/node_modules/@npmcli/
228-
/sigstore/node_modules/@npmcli/*
229-
!/sigstore/node_modules/@npmcli/agent
230-
!/sigstore/node_modules/@npmcli/fs
231-
!/sigstore/node_modules/@sigstore/
232-
/sigstore/node_modules/@sigstore/*
233-
!/sigstore/node_modules/@sigstore/tuf
234-
!/sigstore/node_modules/cacache
235-
!/sigstore/node_modules/make-fetch-happen
236-
!/sigstore/node_modules/minipass-fetch
237-
!/sigstore/node_modules/proc-log
238-
!/sigstore/node_modules/ssri
239-
!/sigstore/node_modules/tuf-js
240-
!/sigstore/node_modules/unique-filename
241-
!/sigstore/node_modules/unique-slug
242212
!/smart-buffer
243213
!/socks-proxy-agent
244214
!/socks
@@ -268,11 +238,6 @@
268238
!/tiny-relative-date
269239
!/treeverse
270240
!/tuf-js
271-
!/tuf-js/node_modules/
272-
/tuf-js/node_modules/*
273-
!/tuf-js/node_modules/@tufjs/
274-
/tuf-js/node_modules/@tufjs/*
275-
!/tuf-js/node_modules/@tufjs/models
276241
!/unique-filename
277242
!/unique-slug
278243
!/util-deprecate

node_modules/@sigstore/bundle/dist/build.js

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
exports.toDSSEBundle = exports.toMessageSignatureBundle = void 0;
3+
exports.toMessageSignatureBundle = toMessageSignatureBundle;
4+
exports.toDSSEBundle = toDSSEBundle;
45
/*
56
Copyright 2023 The Sigstore Authors.
67
@@ -21,9 +22,9 @@ const bundle_1 = require("./bundle");
2122
// Message signature bundle - $case: 'messageSignature'
2223
function toMessageSignatureBundle(options) {
2324
return {
24-
mediaType: options.singleCertificate
25-
? bundle_1.BUNDLE_V03_MEDIA_TYPE
26-
: bundle_1.BUNDLE_V02_MEDIA_TYPE,
25+
mediaType: options.certificateChain
26+
? bundle_1.BUNDLE_V02_MEDIA_TYPE
27+
: bundle_1.BUNDLE_V03_MEDIA_TYPE,
2728
content: {
2829
$case: 'messageSignature',
2930
messageSignature: {
@@ -37,21 +38,19 @@ function toMessageSignatureBundle(options) {
3738
verificationMaterial: toVerificationMaterial(options),
3839
};
3940
}
40-
exports.toMessageSignatureBundle = toMessageSignatureBundle;
4141
// DSSE envelope bundle - $case: 'dsseEnvelope'
4242
function toDSSEBundle(options) {
4343
return {
44-
mediaType: options.singleCertificate
45-
? bundle_1.BUNDLE_V03_MEDIA_TYPE
46-
: bundle_1.BUNDLE_V02_MEDIA_TYPE,
44+
mediaType: options.certificateChain
45+
? bundle_1.BUNDLE_V02_MEDIA_TYPE
46+
: bundle_1.BUNDLE_V03_MEDIA_TYPE,
4747
content: {
4848
$case: 'dsseEnvelope',
4949
dsseEnvelope: toEnvelope(options),
5050
},
5151
verificationMaterial: toVerificationMaterial(options),
5252
};
5353
}
54-
exports.toDSSEBundle = toDSSEBundle;
5554
function toEnvelope(options) {
5655
return {
5756
payloadType: options.artifactType,
@@ -75,20 +74,20 @@ function toVerificationMaterial(options) {
7574
}
7675
function toKeyContent(options) {
7776
if (options.certificate) {
78-
if (options.singleCertificate) {
79-
return {
80-
$case: 'certificate',
81-
certificate: { rawBytes: options.certificate },
82-
};
83-
}
84-
else {
77+
if (options.certificateChain) {
8578
return {
8679
$case: 'x509CertificateChain',
8780
x509CertificateChain: {
8881
certificates: [{ rawBytes: options.certificate }],
8982
},
9083
};
9184
}
85+
else {
86+
return {
87+
$case: 'certificate',
88+
certificate: { rawBytes: options.certificate },
89+
};
90+
}
9291
}
9392
else {
9493
return {
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
exports.isBundleWithDsseEnvelope = exports.isBundleWithMessageSignature = exports.isBundleWithPublicKey = exports.isBundleWithCertificateChain = exports.BUNDLE_V03_MEDIA_TYPE = exports.BUNDLE_V03_LEGACY_MEDIA_TYPE = exports.BUNDLE_V02_MEDIA_TYPE = exports.BUNDLE_V01_MEDIA_TYPE = void 0;
3+
exports.BUNDLE_V03_MEDIA_TYPE = exports.BUNDLE_V03_LEGACY_MEDIA_TYPE = exports.BUNDLE_V02_MEDIA_TYPE = exports.BUNDLE_V01_MEDIA_TYPE = void 0;
4+
exports.isBundleWithCertificateChain = isBundleWithCertificateChain;
5+
exports.isBundleWithPublicKey = isBundleWithPublicKey;
6+
exports.isBundleWithMessageSignature = isBundleWithMessageSignature;
7+
exports.isBundleWithDsseEnvelope = isBundleWithDsseEnvelope;
48
exports.BUNDLE_V01_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.1';
59
exports.BUNDLE_V02_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.2';
610
exports.BUNDLE_V03_LEGACY_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.3';
@@ -9,16 +13,12 @@ exports.BUNDLE_V03_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle.v0.3+json';
913
function isBundleWithCertificateChain(b) {
1014
return b.verificationMaterial.content.$case === 'x509CertificateChain';
1115
}
12-
exports.isBundleWithCertificateChain = isBundleWithCertificateChain;
1316
function isBundleWithPublicKey(b) {
1417
return b.verificationMaterial.content.$case === 'publicKey';
1518
}
16-
exports.isBundleWithPublicKey = isBundleWithPublicKey;
1719
function isBundleWithMessageSignature(b) {
1820
return b.content.$case === 'messageSignature';
1921
}
20-
exports.isBundleWithMessageSignature = isBundleWithMessageSignature;
2122
function isBundleWithDsseEnvelope(b) {
2223
return b.content.$case === 'dsseEnvelope';
2324
}
24-
exports.isBundleWithDsseEnvelope = isBundleWithDsseEnvelope;

node_modules/@sigstore/bundle/dist/validate.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
exports.assertBundleLatest = exports.assertBundleV02 = exports.isBundleV01 = exports.assertBundleV01 = exports.assertBundle = void 0;
3+
exports.assertBundle = assertBundle;
4+
exports.assertBundleV01 = assertBundleV01;
5+
exports.isBundleV01 = isBundleV01;
6+
exports.assertBundleV02 = assertBundleV02;
7+
exports.assertBundleLatest = assertBundleLatest;
48
/*
59
Copyright 2023 The Sigstore Authors.
610
@@ -27,7 +31,6 @@ function assertBundle(b) {
2731
throw new error_1.ValidationError('invalid bundle', invalidValues);
2832
}
2933
}
30-
exports.assertBundle = assertBundle;
3134
// Asserts that the given bundle conforms to the v0.1 bundle format.
3235
function assertBundleV01(b) {
3336
const invalidValues = [];
@@ -37,7 +40,6 @@ function assertBundleV01(b) {
3740
throw new error_1.ValidationError('invalid v0.1 bundle', invalidValues);
3841
}
3942
}
40-
exports.assertBundleV01 = assertBundleV01;
4143
// Type guard to determine if Bundle is a v0.1 bundle.
4244
function isBundleV01(b) {
4345
try {
@@ -48,7 +50,6 @@ function isBundleV01(b) {
4850
return false;
4951
}
5052
}
51-
exports.isBundleV01 = isBundleV01;
5253
// Asserts that the given bundle conforms to the v0.2 bundle format.
5354
function assertBundleV02(b) {
5455
const invalidValues = [];
@@ -58,7 +59,6 @@ function assertBundleV02(b) {
5859
throw new error_1.ValidationError('invalid v0.2 bundle', invalidValues);
5960
}
6061
}
61-
exports.assertBundleV02 = assertBundleV02;
6262
// Asserts that the given bundle conforms to the newest (0.3) bundle format.
6363
function assertBundleLatest(b) {
6464
const invalidValues = [];
@@ -69,7 +69,6 @@ function assertBundleLatest(b) {
6969
throw new error_1.ValidationError('invalid bundle', invalidValues);
7070
}
7171
}
72-
exports.assertBundleLatest = assertBundleLatest;
7372
function validateBundleBase(b) {
7473
const invalidValues = [];
7574
// Media type validation
@@ -192,6 +191,7 @@ function validateInclusionProof(b) {
192191
// Necessary for V03 and later bundles
193192
function validateNoCertificateChain(b) {
194193
const invalidValues = [];
194+
/* istanbul ignore next */
195195
if (b.verificationMaterial?.content?.$case === 'x509CertificateChain') {
196196
invalidValues.push('verificationMaterial.content.$case');
197197
}

node_modules/@sigstore/bundle/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sigstore/bundle",
3-
"version": "2.3.2",
3+
"version": "3.0.0",
44
"description": "Sigstore bundle type",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -30,6 +30,6 @@
3030
"@sigstore/protobuf-specs": "^0.3.2"
3131
},
3232
"engines": {
33-
"node": "^16.14.0 || >=18.0.0"
33+
"node": "^18.17.0 || >=20.5.0"
3434
}
3535
}

node_modules/@sigstore/core/dist/asn1/length.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ See the License for the specific language governing permissions and
1515
limitations under the License.
1616
*/
1717
Object.defineProperty(exports, "__esModule", { value: true });
18-
exports.encodeLength = exports.decodeLength = void 0;
18+
exports.decodeLength = decodeLength;
19+
exports.encodeLength = encodeLength;
1920
const error_1 = require("./error");
2021
// Decodes the length of a DER-encoded ANS.1 element from the supplied stream.
2122
// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-encoded-length-and-value-bytes
@@ -44,7 +45,6 @@ function decodeLength(stream) {
4445
}
4546
return len;
4647
}
47-
exports.decodeLength = decodeLength;
4848
// Translates the supplied value to a DER-encoded length.
4949
function encodeLength(len) {
5050
if (len < 128) {
@@ -60,4 +60,3 @@ function encodeLength(len) {
6060
}
6161
return Buffer.from([0x80 | bytes.length, ...bytes]);
6262
}
63-
exports.encodeLength = encodeLength;

node_modules/@sigstore/core/dist/asn1/parse.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
exports.parseBitString = exports.parseBoolean = exports.parseOID = exports.parseTime = exports.parseStringASCII = exports.parseInteger = void 0;
3+
exports.parseInteger = parseInteger;
4+
exports.parseStringASCII = parseStringASCII;
5+
exports.parseTime = parseTime;
6+
exports.parseOID = parseOID;
7+
exports.parseBoolean = parseBoolean;
8+
exports.parseBitString = parseBitString;
49
/*
510
Copyright 2023 The Sigstore Authors.
611
@@ -43,13 +48,11 @@ function parseInteger(buf) {
4348
}
4449
return n;
4550
}
46-
exports.parseInteger = parseInteger;
4751
// Parse an ASCII string from the DER-encoded buffer
4852
// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-basic-types#boolean
4953
function parseStringASCII(buf) {
5054
return buf.toString('ascii');
5155
}
52-
exports.parseStringASCII = parseStringASCII;
5356
// Parse a Date from the DER-encoded buffer
5457
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.5.1
5558
function parseTime(buf, shortYear) {
@@ -70,7 +73,6 @@ function parseTime(buf, shortYear) {
7073
// Translate to ISO8601 format and parse
7174
return new Date(`${m[1]}-${m[2]}-${m[3]}T${m[4]}:${m[5]}:${m[6]}Z`);
7275
}
73-
exports.parseTime = parseTime;
7476
// Parse an OID from the DER-encoded buffer
7577
// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-object-identifier
7678
function parseOID(buf) {
@@ -95,13 +97,11 @@ function parseOID(buf) {
9597
}
9698
return oid;
9799
}
98-
exports.parseOID = parseOID;
99100
// Parse a boolean from the DER-encoded buffer
100101
// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-basic-types#boolean
101102
function parseBoolean(buf) {
102103
return buf[0] !== 0;
103104
}
104-
exports.parseBoolean = parseBoolean;
105105
// Parse a bit string from the DER-encoded buffer
106106
// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-bit-string
107107
function parseBitString(buf) {
@@ -122,4 +122,3 @@ function parseBitString(buf) {
122122
}
123123
return bits;
124124
}
125-
exports.parseBitString = parseBitString;

node_modules/@sigstore/core/dist/crypto.js

+4-15
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
return (mod && mod.__esModule) ? mod : { "default": mod };
44
};
55
Object.defineProperty(exports, "__esModule", { value: true });
6-
exports.bufferEqual = exports.verify = exports.hash = exports.digest = exports.createPublicKey = void 0;
6+
exports.createPublicKey = createPublicKey;
7+
exports.digest = digest;
8+
exports.verify = verify;
9+
exports.bufferEqual = bufferEqual;
710
/*
811
Copyright 2023 The Sigstore Authors.
912
@@ -20,7 +23,6 @@ See the License for the specific language governing permissions and
2023
limitations under the License.
2124
*/
2225
const crypto_1 = __importDefault(require("crypto"));
23-
const SHA256_ALGORITHM = 'sha256';
2426
function createPublicKey(key, type = 'spki') {
2527
if (typeof key === 'string') {
2628
return crypto_1.default.createPublicKey(key);
@@ -29,24 +31,13 @@ function createPublicKey(key, type = 'spki') {
2931
return crypto_1.default.createPublicKey({ key, format: 'der', type: type });
3032
}
3133
}
32-
exports.createPublicKey = createPublicKey;
3334
function digest(algorithm, ...data) {
3435
const hash = crypto_1.default.createHash(algorithm);
3536
for (const d of data) {
3637
hash.update(d);
3738
}
3839
return hash.digest();
3940
}
40-
exports.digest = digest;
41-
// TODO: deprecate this in favor of digest()
42-
function hash(...data) {
43-
const hash = crypto_1.default.createHash(SHA256_ALGORITHM);
44-
for (const d of data) {
45-
hash.update(d);
46-
}
47-
return hash.digest();
48-
}
49-
exports.hash = hash;
5041
function verify(data, key, signature, algorithm) {
5142
// The try/catch is to work around an issue in Node 14.x where verify throws
5243
// an error in some scenarios if the signature is invalid.
@@ -58,7 +49,6 @@ function verify(data, key, signature, algorithm) {
5849
return false;
5950
}
6051
}
61-
exports.verify = verify;
6252
function bufferEqual(a, b) {
6353
try {
6454
return crypto_1.default.timingSafeEqual(a, b);
@@ -68,4 +58,3 @@ function bufferEqual(a, b) {
6858
return false;
6959
}
7060
}
71-
exports.bufferEqual = bufferEqual;

node_modules/@sigstore/core/dist/dsse.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
exports.preAuthEncoding = void 0;
3+
exports.preAuthEncoding = preAuthEncoding;
44
/*
55
Copyright 2023 The Sigstore Authors.
66
@@ -28,4 +28,3 @@ function preAuthEncoding(payloadType, payload) {
2828
].join(' ');
2929
return Buffer.concat([Buffer.from(prefix, 'ascii'), payload]);
3030
}
31-
exports.preAuthEncoding = preAuthEncoding;

0 commit comments

Comments
 (0)