@rstreamlabs/webtty 1.9.0 → 1.10.0

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/node.mjs CHANGED
@@ -33,15 +33,19 @@ import {
33
33
  verifyWebTTYServerProofTranscript,
34
34
  webTTYClientProofTranscriptBytes,
35
35
  webTTYE2EKeyID,
36
+ webTTYFIPSCompatibleKeyEnvelopeSuite,
37
+ webTTYFIPSCompatiblePayloadSuite,
36
38
  webTTYRecordedEventEncryptedPayload,
37
39
  webTTYServerProofTranscriptBytes,
38
40
  webTTYSigningKeyID
39
- } from "./chunk-7OHAFDJE.mjs";
41
+ } from "./chunk-6DA72SBW.mjs";
40
42
 
41
43
  // src/local-e2e.ts
42
44
  var localKeyFileVersion = 1;
43
45
  var localKeyFileCryptoSuite = "webtty-e2e-x25519-hpke-aes-256-gcm-v1";
46
+ var localKeyFileFIPSCompatibleCryptoSuite = "webtty-e2e-p256-hkdf-sha256-aes-256-gcm-random-nonce-v1";
44
47
  var x25519PublicKeySize = 32;
48
+ var p256PublicKeySize = 65;
45
49
  var payloadKeyIDSize = 16;
46
50
  var knownServerKeyEnv = "RSTREAM_WEBTTY_KNOWN_SERVER_KEY";
47
51
  var knownServersFileEnv = "RSTREAM_WEBTTY_KNOWN_SERVERS_FILE";
@@ -69,9 +73,8 @@ async function parseWebTTYKnownServerKey(value) {
69
73
  validateSigningKeyMaterial(parts[2] ?? "", parts[3] ?? "");
70
74
  }
71
75
  if (parts.length === 1) {
72
- const publicKey2 = decodeFixedKeyMaterial(
76
+ const publicKey2 = decodeEncryptionPublicKey(
73
77
  parts[0] ?? "",
74
- x25519PublicKeySize,
75
78
  "known WebTTY server public key"
76
79
  );
77
80
  return { keyId: await webTTYE2EKeyID(publicKey2), publicKey: publicKey2 };
@@ -81,9 +84,8 @@ async function parseWebTTYKnownServerKey(value) {
81
84
  payloadKeyIDSize,
82
85
  "known WebTTY server key id"
83
86
  );
84
- const publicKey = decodeFixedKeyMaterial(
87
+ const publicKey = decodeEncryptionPublicKey(
85
88
  parts[1] ?? "",
86
- x25519PublicKeySize,
87
89
  "known WebTTY server public key"
88
90
  );
89
91
  const expectedKeyId = await webTTYE2EKeyID(publicKey);
@@ -178,7 +180,7 @@ function decodeWebTTYKnownServerKeysFile(data, filePath) {
178
180
  );
179
181
  }
180
182
  const cryptoSuite = parsed.crypto_suite;
181
- if (cryptoSuite !== localKeyFileCryptoSuite) {
183
+ if (cryptoSuite !== localKeyFileCryptoSuite && cryptoSuite !== localKeyFileFIPSCompatibleCryptoSuite) {
182
184
  throw new Error(
183
185
  `unsupported known WebTTY server keys crypto suite ${String(cryptoSuite)}`
184
186
  );
@@ -288,6 +290,16 @@ function decodeFixedKeyMaterial(value, size, label) {
288
290
  }
289
291
  return decoded;
290
292
  }
293
+ function decodeEncryptionPublicKey(value, label) {
294
+ const decoded = decodeWebTTYE2EKeyMaterial(value.trim());
295
+ if (decoded.byteLength === x25519PublicKeySize) return decoded;
296
+ if (decoded.byteLength === p256PublicKeySize && decoded[0] === 4) {
297
+ return decoded;
298
+ }
299
+ throw new Error(
300
+ `${label} must decode to a ${x25519PublicKeySize}-byte X25519 key or an uncompressed ${p256PublicKeySize}-byte P-256 point`
301
+ );
302
+ }
291
303
  function validateSigningKeyMaterial(keyID, publicKey) {
292
304
  decodeFixedKeyMaterial(keyID, 32, "known WebTTY server signing key id");
293
305
  decodeWebTTYE2EKeyMaterial(publicKey.trim());
@@ -445,6 +457,8 @@ export {
445
457
  verifyWebTTYServerProofTranscript,
446
458
  webTTYClientProofTranscriptBytes,
447
459
  webTTYE2EKeyID,
460
+ webTTYFIPSCompatibleKeyEnvelopeSuite,
461
+ webTTYFIPSCompatiblePayloadSuite,
448
462
  webTTYRecordedEventEncryptedPayload,
449
463
  webTTYServerProofTranscriptBytes,
450
464
  webTTYSigningKeyID
@@ -6,15 +6,15 @@
6
6
  "type": "module",
7
7
  "dependencies": {
8
8
  "@rstreamlabs/webtty": "file:../..",
9
- "dotenv": "^17.2.2"
9
+ "dotenv": "^17.4.2"
10
10
  },
11
11
  "scripts": {
12
12
  "start": "tsx src/main.ts",
13
13
  "type-check": "tsc --noEmit"
14
14
  },
15
15
  "devDependencies": {
16
- "@types/node": "^25",
17
- "tsx": "^4.21.0",
18
- "typescript": "5.9.3"
16
+ "@types/node": "^26",
17
+ "tsx": "^4.23.1",
18
+ "typescript": "7.0.2"
19
19
  }
20
20
  }
@@ -6,15 +6,15 @@
6
6
  "type": "module",
7
7
  "dependencies": {
8
8
  "@rstreamlabs/webtty": "file:../..",
9
- "dotenv": "^17.2.2"
9
+ "dotenv": "^17.4.2"
10
10
  },
11
11
  "scripts": {
12
12
  "start": "tsx src/main.ts",
13
13
  "type-check": "tsc --noEmit"
14
14
  },
15
15
  "devDependencies": {
16
- "@types/node": "^25",
17
- "tsx": "^4.21.0",
18
- "typescript": "5.9.3"
16
+ "@types/node": "^26",
17
+ "tsx": "^4.23.1",
18
+ "typescript": "7.0.2"
19
19
  }
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rstreamlabs/webtty",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Client-side implementation of the rstream WebTTY protocol.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,17 +41,18 @@
41
41
  "type-check": "tsc --noEmit"
42
42
  },
43
43
  "devDependencies": {
44
- "@turbo/gen": "^2.9.5",
45
- "@types/node": "^25",
44
+ "@turbo/gen": "^2.10.11",
45
+ "@types/node": "^26",
46
+ "eslint": "9.39.5",
46
47
  "eslint-config": "*",
47
- "eslint": "9.39.4",
48
- "protobufjs-cli": "^2.4.0",
48
+ "protobufjs-cli": "^2.6.2",
49
49
  "tsup": "^8.5.1",
50
+ "typescript": "6.0.3",
50
51
  "typescript-config": "*",
51
- "typescript": "5.9.3"
52
+ "ws": "^8.21.3"
52
53
  },
53
54
  "dependencies": {
54
- "protobufjs": "^8.4.0"
55
+ "protobufjs": "^8.7.2"
55
56
  },
56
57
  "publishConfig": {
57
58
  "access": "public"