@reclaimprotocol/attestor-core 5.1.4 → 5.1.6
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/browser/resources/attestor-browser.min.mjs +902 -1068
- package/lib/external-rpc/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/providers/http/response-charset.d.ts +1 -0
- package/lib/server/utils/tee-transcript-reconstruction.d.ts +12 -0
- package/lib/types/providers.d.ts +2 -0
- package/package.json +3 -3
|
@@ -9177,7 +9177,7 @@ var HTTP_PROVIDER = {
|
|
|
9177
9177
|
body = dechunkResponseBody(body);
|
|
9178
9178
|
}
|
|
9179
9179
|
}
|
|
9180
|
-
const charset = shouldRevealCrlf(ctx) ? getResponseBodyCharset(headersText) : void 0;
|
|
9180
|
+
const charset = shouldRevealCrlf(ctx) ? ctx.authenticatedResponseCharset ?? getResponseBodyCharset(headersText) : void 0;
|
|
9181
9181
|
const bodyText = decodeResponseBody(body, charset);
|
|
9182
9182
|
let res = headersText + bodyText;
|
|
9183
9183
|
const dateHeader = makeRegex(dateHeaderRegex).exec(res);
|
package/lib/index.js
CHANGED
|
@@ -7475,7 +7475,7 @@ var HTTP_PROVIDER = {
|
|
|
7475
7475
|
body = dechunkResponseBody(body);
|
|
7476
7476
|
}
|
|
7477
7477
|
}
|
|
7478
|
-
const charset = shouldRevealCrlf(ctx) ? getResponseBodyCharset(headersText) : void 0;
|
|
7478
|
+
const charset = shouldRevealCrlf(ctx) ? ctx.authenticatedResponseCharset ?? getResponseBodyCharset(headersText) : void 0;
|
|
7479
7479
|
const bodyText = decodeResponseBody(body, charset);
|
|
7480
7480
|
let res = headersText + bodyText;
|
|
7481
7481
|
const dateHeader = makeRegex(dateHeaderRegex).exec(res);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function detectResponseCharset(body: Uint8Array, contentType?: string, completeBody?: boolean): string | undefined;
|
|
@@ -8,6 +8,7 @@ export interface TeeTranscriptData {
|
|
|
8
8
|
revealedRequest: Uint8Array;
|
|
9
9
|
reconstructedResponse: Uint8Array;
|
|
10
10
|
certificateInfo?: CertificateInfo;
|
|
11
|
+
authenticatedResponseCharset?: string;
|
|
11
12
|
responseTrimOffset?: number;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
@@ -22,3 +23,14 @@ export declare function reconstructTlsTranscript(bundleData: TeeBundleData, logg
|
|
|
22
23
|
length: number;
|
|
23
24
|
output: Uint8Array;
|
|
24
25
|
}>): Promise<TeeTranscriptData>;
|
|
26
|
+
/** Use only original bytes before the first signed redaction or replacement.
|
|
27
|
+
* Called after TEE signature verification and before trimming/dechunking/OPRF.
|
|
28
|
+
* No client-supplied charset or inspection of replacement asterisks is used.
|
|
29
|
+
*/
|
|
30
|
+
export declare function charsetFromAuthenticatedPrefix(response: Uint8Array, redactions: Array<{
|
|
31
|
+
start: number;
|
|
32
|
+
length: number;
|
|
33
|
+
}>, replacements?: Array<{
|
|
34
|
+
position: number;
|
|
35
|
+
length: number;
|
|
36
|
+
}>, strictChunkFraming?: boolean): string | undefined;
|
package/lib/types/providers.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export type RedactionMode = 'key-update' | 'zk';
|
|
|
26
26
|
export type ProviderField<Params, SecretParams, T> = T | ((params: Params, secretParams?: SecretParams) => T);
|
|
27
27
|
export type ProviderCtx = {
|
|
28
28
|
version: AttestorVersion;
|
|
29
|
+
/** Server-derived from original authenticated bytes, never claim parameters. */
|
|
30
|
+
authenticatedResponseCharset?: string;
|
|
29
31
|
};
|
|
30
32
|
type GetResponseRedactionsOpts<P> = {
|
|
31
33
|
response: Uint8Array;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reclaimprotocol/attestor-core",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"imports": {
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"@peculiar/asn1-x509": "^2.6.1",
|
|
93
93
|
"@peculiar/webcrypto": "^1.5.0",
|
|
94
94
|
"@peculiar/x509": "^1.14.3",
|
|
95
|
-
"@reclaimprotocol/tls": "^0.1.
|
|
96
|
-
"@reclaimprotocol/zk-symmetric-crypto": "^5.1.
|
|
95
|
+
"@reclaimprotocol/tls": "^0.1.5",
|
|
96
|
+
"@reclaimprotocol/zk-symmetric-crypto": "^5.1.7",
|
|
97
97
|
"ajv": "^8.18.0",
|
|
98
98
|
"bs58": "^6.0.0",
|
|
99
99
|
"canonicalize": "^2.1.0",
|