@appliedblockchain/silentdatarollup-core 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -32,8 +32,9 @@ import {
32
32
  getAuthEIP721Types,
33
33
  getAuthHeaders,
34
34
  isSignableContractCall,
35
- prepareTypedDataPayload
36
- } from "./chunk-53A5RGL2.mjs";
35
+ prepareTypedDataPayload,
36
+ validateTdxAttestation
37
+ } from "./chunk-RWLHE5DT.mjs";
37
38
  export {
38
39
  ChainId,
39
40
  DEBUG_NAMESPACE,
@@ -68,5 +69,6 @@ export {
68
69
  getAuthEIP721Types,
69
70
  getAuthHeaders,
70
71
  isSignableContractCall,
71
- prepareTypedDataPayload
72
+ prepareTypedDataPayload,
73
+ validateTdxAttestation
72
74
  };
package/dist/tests.js CHANGED
@@ -65,6 +65,187 @@ var log2 = (0, import_debug2.default)(DEBUG_NAMESPACE);
65
65
  // src/contract.ts
66
66
  var import_ethers5 = require("ethers");
67
67
 
68
+ // src/audit/challenge.ts
69
+ var import_ethers7 = require("ethers");
70
+
71
+ // src/audit/quote/validateTdxQuote.ts
72
+ var x5095 = __toESM(require("@peculiar/x509"));
73
+
74
+ // src/audit/quote/quoteStructs.ts
75
+ var ErrQuoteV4AuthDataNil = new Error("QuoteV4 authData is nil");
76
+ var ErrQuoteV4Nil = new Error("QuoteV4 is nil");
77
+ var ErrHeaderNil = new Error("header is nil");
78
+ var ErrAttestationKeyType = new Error(
79
+ "attestation key type not supported"
80
+ );
81
+ var ErrTeeType = new Error("TEE type is not TDX");
82
+ var ErrTDQuoteBodyNil = new Error("TD quote body is nil");
83
+ var ErrQeReportNil = new Error("QE Report is nil");
84
+
85
+ // src/audit/quote/base64-utils.ts
86
+ var asn1js = __toESM(require("asn1js"));
87
+ var x509 = __toESM(require("@peculiar/x509"));
88
+
89
+ // src/audit/quote/validate.ts
90
+ var tdxAttributesSeptVeDisSupport = 1n << 28n;
91
+ var tdxAttributesPksSupport = 1n << 30n;
92
+ var tdxAttributesPerfmonSupport = 1n << 63n;
93
+ var tdAttributesFixed0 = 0x1n | tdxAttributesSeptVeDisSupport | tdxAttributesPksSupport | tdxAttributesPerfmonSupport;
94
+
95
+ // src/audit/quote/verify.ts
96
+ var x5094 = __toESM(require("@peculiar/x509"));
97
+
98
+ // src/audit/quote/pck.ts
99
+ var asn1js3 = __toESM(require("asn1js"));
100
+
101
+ // src/audit/quote/tcb.ts
102
+ var asn1js2 = __toESM(require("asn1js"));
103
+ var x5092 = __toESM(require("@peculiar/x509"));
104
+ var ErrRootCertNil = new Error("root certificate is empty");
105
+ var ErrCollateralNil = new Error(
106
+ "collateral received is an empty structure"
107
+ );
108
+ var ErrTcbInfoTcbLevelsMissing = new Error(
109
+ "tcbInfo contains empty TcbLevels"
110
+ );
111
+ var ErrQeIdentityTcbLevelsMissing = new Error(
112
+ "QeIdentity contains empty TcbLevels"
113
+ );
114
+ var ErrCrlEmpty = new Error("CRL is empty");
115
+ var ErrTrustedCertEmpty = new Error("trusted certificate is empty");
116
+ var ErrTcbStatus = new Error(
117
+ "unable to find latest status of TCB, it is now OutOfDate"
118
+ );
119
+
120
+ // src/audit/quote/pck.ts
121
+ var ErrPckCertChainNil = new Error("PCK certificate chain is nil");
122
+ var ErrPCKCertChainInvalid = new Error(
123
+ "incomplete PCK Certificate chain found, should contain 3 concatenated PEM-formatted 'CERTIFICATE'-type block (PCK Leaf Cert||Intermediate CA Cert||Root CA Cert)"
124
+ );
125
+ var ErrRootCaCertExpired = new Error(
126
+ "root CA certificate in PCK certificate chain has expired"
127
+ );
128
+ var ErrIntermediateCertNil = new Error(
129
+ "intermediate certificate is empty"
130
+ );
131
+ var ErrPCKCertNil = new Error("PCK certificate is empty");
132
+ var ErrRevocationCheckFailed = new Error(
133
+ "unable to check for certificate revocation as GetCollateral parameter in the options is set to false"
134
+ );
135
+ var ErrIntermediateCaCertExpired = new Error(
136
+ "intermediate CA certificate in PCK certificate chain has expired"
137
+ );
138
+ var ErrPckLeafCertExpired = new Error(
139
+ "PCK leaf certificate in PCK certificate chain has expired"
140
+ );
141
+ var ErrPckCertCANil = new Error(
142
+ "could not find CA from PCK certificate"
143
+ );
144
+
145
+ // src/audit/quote/collateral.ts
146
+ var x5093 = __toESM(require("@peculiar/x509"));
147
+ var asn1js4 = __toESM(require("asn1js"));
148
+ var ErrMissingTcbInfoBody = new Error(
149
+ "missing tcbInfo body in the collaterals obtained"
150
+ );
151
+ var ErrMissingEnclaveIdentityBody = new Error(
152
+ "missing enclaveIdentity body in the collaterals obtained"
153
+ );
154
+ var ErrTcbInfoNil = new Error("tcbInfo is empty in collaterals");
155
+ var ErrQeIdentityNil = new Error("QeIdentity is empty in collaterals");
156
+ var ErrMissingTcbInfoSigningCert = new Error(
157
+ "missing signing certificate in the issuer chain of tcbInfo"
158
+ );
159
+ var ErrMissingTcbInfoRootCert = new Error(
160
+ "missing root certificate in the issuer chain of tcbInfo"
161
+ );
162
+ var ErrMissingQeIdentitySigningCert = new Error(
163
+ "missing signing certificate in the issuer chain of QeIdentity"
164
+ );
165
+ var ErrMissingQeIdentityRootCert = new Error(
166
+ "missing root certificate in the issuer chain of QeIdentity"
167
+ );
168
+ var ErrMissingPckCrl = new Error(
169
+ "missing PCK CRL in the collaterals obtained"
170
+ );
171
+ var ErrMissingRootCaCrl = new Error(
172
+ "missing ROOT CA CRL in the collaterals obtained"
173
+ );
174
+ var ErrMissingPCKCrlSigningCert = new Error(
175
+ "missing signing certificate in the issuer chain of PCK CRL"
176
+ );
177
+ var ErrMissingPCKCrlRootCert = new Error(
178
+ "missing root certificate in the issuer chain of PCK CRL"
179
+ );
180
+ var ErrTcbInfoExpired = new Error("tcbInfo has expired");
181
+ var ErrQeIdentityExpired = new Error("QeIdentity has expired");
182
+ var ErrTcbInfoSigningCertExpired = new Error(
183
+ "tcbInfo signing certificate has expired"
184
+ );
185
+ var ErrTcbInfoRootCertExpired = new Error(
186
+ "tcbInfo root certificate has expired"
187
+ );
188
+ var ErrQeIdentityRootCertExpired = new Error(
189
+ "QeIdentity root certificate has expired"
190
+ );
191
+ var ErrQeIdentitySigningCertExpired = new Error(
192
+ "QeIdentity signing certificate has expired"
193
+ );
194
+ var ErrRootCaCrlExpired = new Error("root CA CRL has expired");
195
+ var ErrPCKCrlExpired = new Error("PCK CRL has expired");
196
+ var ErrPCKCrlSigningCertExpired = new Error(
197
+ "PCK CRL signing certificate has expired"
198
+ );
199
+ var ErrPCKCrlRootCertExpired = new Error(
200
+ "PCK CRL root certificate has expired"
201
+ );
202
+ var ErrEmptyRootCRLUrl = new Error(
203
+ "empty url found in QeIdentity issuer's chain which is required to receive ROOT CA CRL"
204
+ );
205
+
206
+ // src/audit/quote/verify.ts
207
+ var ErrOptionsNil = new Error("options parameter is empty");
208
+ var ErrRootCaCertExpired2 = new Error(
209
+ "root CA certificate in PCK certificate chain has expired"
210
+ );
211
+ var ErrHashVerificationFail = new Error(
212
+ "unable to verify message digest using quote's signature and ecdsa attestation key"
213
+ );
214
+ var ErrSHA256VerificationFail = new Error(
215
+ "QE Report Data does not match with value of SHA 256 calculated over the concatenation of ECDSA Attestation Key and QE Authenticated Data"
216
+ );
217
+
218
+ // src/audit/quote/validateTdxQuote.ts
219
+ var ErrCertificationDataNil = new Error("certification data is nil");
220
+ var ErrQeReportCertificationDataNil = new Error(
221
+ "QE Report certification data is nil"
222
+ );
223
+ var ErrQeAuthDataNil = new Error("QE AuthData is nil");
224
+ var ErrCertNil = new Error("certificate is nil");
225
+ var ErrParentCertNil = new Error("parent certificate is nil");
226
+ var ErrCertPubKeyType = new Error(
227
+ "certificate public key is not of type ecdsa public key"
228
+ );
229
+ var ErrRootCaCertExpired3 = new Error(
230
+ "root CA certificate in PCK certificate chain has expired"
231
+ );
232
+ var ErrPublicKeySize = new Error("public key is of unexpected size");
233
+ var ErrPckExtInvalid = new Error(
234
+ "unexpected leftover bytes for PCK certificate's extension"
235
+ );
236
+ var ErrSgxExtInvalid = new Error(
237
+ "unexpected leftover bytes when parsing SGX extensions"
238
+ );
239
+ var ErrTcbExtInvalid = new Error(
240
+ "unexpected leftover bytes for TCB extension inside SGX extension field"
241
+ );
242
+ var ErrTcbCompInvalid = new Error(
243
+ "unexpected leftover bytes for TCB components in TCB Extension inside SGX extension field"
244
+ );
245
+
246
+ // src/audit/registry.ts
247
+ var import_ethers6 = require("ethers");
248
+
68
249
  // tests/utils/mocked-custom-grpc.ts
69
250
  var import_http = __toESM(require("http"));
70
251
  var currentPort = 3e3;
package/dist/tests.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-53A5RGL2.mjs";
1
+ import "./chunk-RWLHE5DT.mjs";
2
2
 
3
3
  // tests/utils/mocked-custom-grpc.ts
4
4
  import http from "http";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appliedblockchain/silentdatarollup-core",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Core library for Silent Data",
5
5
  "author": "Applied Blockchain",
6
6
  "homepage": "https://github.com/appliedblockchain/silent-data-rollup-providers#readme",
@@ -29,6 +29,8 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
+ "@peculiar/x509": "1.14.2",
33
+ "asn1js": "3.0.7",
32
34
  "debug": "4.3.7",
33
35
  "ethers": "6.13.2"
34
36
  },