File tree Expand file tree Collapse file tree 11 files changed +37
-7
lines changed
node_modules/@sigstore/core Expand file tree Collapse file tree 11 files changed +37
-7
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ const length_1 = require("./length");
2222const parse_1 = require ( "./parse" ) ;
2323const tag_1 = require ( "./tag" ) ;
2424class ASN1Obj {
25+ tag ;
26+ subs ;
27+ value ;
2528 constructor ( tag , value , subs ) {
2629 this . tag = tag ;
2730 this . value = value ;
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ const TAG_CLASS = {
3737} ;
3838// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-encoded-tag-bytes
3939class ASN1Tag {
40+ number ;
41+ constructed ;
42+ class ;
4043 constructor ( enc ) {
4144 // Bits 0 through 4 are the tag number
4245 this . number = enc & 0x1f ;
Original file line number Diff line number Diff line change 11"use strict" ;
22Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
3- exports . SHA2_HASH_ALGOS = exports . ECDSA_SIGNATURE_ALGOS = void 0 ;
3+ exports . SHA2_HASH_ALGOS = exports . RSA_SIGNATURE_ALGOS = exports . ECDSA_SIGNATURE_ALGOS = void 0 ;
44exports . ECDSA_SIGNATURE_ALGOS = {
55 '1.2.840.10045.4.3.1' : 'sha224' ,
66 '1.2.840.10045.4.3.2' : 'sha256' ,
77 '1.2.840.10045.4.3.3' : 'sha384' ,
88 '1.2.840.10045.4.3.4' : 'sha512' ,
99} ;
10+ exports . RSA_SIGNATURE_ALGOS = {
11+ '1.2.840.113549.1.1.14' : 'sha224' ,
12+ '1.2.840.113549.1.1.11' : 'sha256' ,
13+ '1.2.840.113549.1.1.12' : 'sha384' ,
14+ '1.2.840.113549.1.1.13' : 'sha512' ,
15+ } ;
1016exports . SHA2_HASH_ALGOS = {
1117 '2.16.840.1.101.3.4.2.1' : 'sha256' ,
1218 '2.16.840.1.101.3.4.2.2' : 'sha384' ,
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ const OID_PKCS9_CONTENT_TYPE_SIGNED_DATA = '1.2.840.113549.1.7.2';
5858const OID_PKCS9_CONTENT_TYPE_TSTINFO = '1.2.840.113549.1.9.16.1.4' ;
5959const OID_PKCS9_MESSAGE_DIGEST_KEY = '1.2.840.113549.1.9.4' ;
6060class RFC3161Timestamp {
61+ root ;
6162 constructor ( asn1 ) {
6263 this . root = asn1 ;
6364 }
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ const crypto = __importStar(require("../crypto"));
3838const oid_1 = require ( "../oid" ) ;
3939const error_1 = require ( "./error" ) ;
4040class TSTInfo {
41+ root ;
4142 constructor ( asn1 ) {
4243 this . root = asn1 ;
4344 }
Original file line number Diff line number Diff line change @@ -19,14 +19,17 @@ limitations under the License.
1919class StreamError extends Error {
2020}
2121class ByteStream {
22+ static BLOCK_SIZE = 1024 ;
23+ buf ;
24+ view ;
25+ start = 0 ;
2226 constructor ( buffer ) {
23- this . start = 0 ;
2427 if ( buffer ) {
2528 this . buf = buffer ;
2629 this . view = Buffer . from ( buffer ) ;
2730 }
2831 else {
29- this . buf = new ArrayBuffer ( 0 ) ;
32+ this . buf = Buffer . alloc ( 0 ) ;
3033 this . view = Buffer . from ( this . buf ) ;
3134 }
3235 }
@@ -103,7 +106,7 @@ class ByteStream {
103106 }
104107 }
105108 realloc ( size ) {
106- const newArray = new ArrayBuffer ( size ) ;
109+ const newArray = Buffer . alloc ( size ) ;
107110 const newView = Buffer . from ( newArray ) ;
108111 // Copy the old buffer into the new one
109112 newView . set ( this . view ) ;
@@ -112,4 +115,3 @@ class ByteStream {
112115 }
113116}
114117exports . ByteStream = ByteStream ;
115- ByteStream . BLOCK_SIZE = 1024 ;
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ const EXTENSION_OID_BASIC_CONSTRAINTS = '2.5.29.19';
6161const EXTENSION_OID_AUTHORITY_KEY_ID = '2.5.29.35' ;
6262exports . EXTENSION_OID_SCT = '1.3.6.1.4.1.11129.2.4.2' ;
6363class X509Certificate {
64+ root ;
6465 constructor ( asn1 ) {
6566 this . root = asn1 ;
6667 }
@@ -99,6 +100,9 @@ class X509Certificate {
99100 }
100101 get signatureAlgorithm ( ) {
101102 const oid = this . signatureAlgorithmObj . subs [ 0 ] . toOID ( ) ;
103+ if ( oid_1 . RSA_SIGNATURE_ALGOS [ oid ] ) {
104+ return oid_1 . RSA_SIGNATURE_ALGOS [ oid ] ;
105+ }
102106 return oid_1 . ECDSA_SIGNATURE_ALGOS [ oid ] ;
103107 }
104108 get signatureValue ( ) {
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const stream_1 = require("../stream");
55const sct_1 = require ( "./sct" ) ;
66// https://www.rfc-editor.org/rfc/rfc5280#section-4.1
77class X509Extension {
8+ root ;
89 constructor ( asn1 ) {
910 this . root = asn1 ;
1011 }
Original file line number Diff line number Diff line change @@ -52,6 +52,13 @@ limitations under the License.
5252const crypto = __importStar ( require ( "../crypto" ) ) ;
5353const stream_1 = require ( "../stream" ) ;
5454class SignedCertificateTimestamp {
55+ version ;
56+ logID ;
57+ timestamp ;
58+ extensions ;
59+ hashAlgorithm ;
60+ signatureAlgorithm ;
61+ signature ;
5562 constructor ( options ) {
5663 this . version = options . version ;
5764 this . logID = options . logID ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @sigstore/core" ,
3- "version" : " 3.0 .0" ,
3+ "version" : " 3.1 .0" ,
44 "description" : " Base library for Sigstore" ,
55 "main" : " dist/index.js" ,
66 "types" : " dist/index.d.ts" ,
You can’t perform that action at this time.
0 commit comments