@mtkruto/browser 0.132.0 → 0.133.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.
Files changed (83) hide show
  1. package/esm/0_deps.d.ts +2 -2
  2. package/esm/0_deps.d.ts.map +1 -1
  3. package/esm/0_deps.js +2 -2
  4. package/esm/2_connection.d.ts +2 -0
  5. package/esm/2_connection.d.ts.map +1 -1
  6. package/esm/2_connection.js +2 -0
  7. package/esm/3_transport.d.ts +1 -0
  8. package/esm/3_transport.d.ts.map +1 -1
  9. package/esm/3_transport.js +1 -0
  10. package/esm/connection/0_get_tls_header.d.ts +2 -0
  11. package/esm/connection/0_get_tls_header.d.ts.map +1 -0
  12. package/esm/connection/0_get_tls_header.js +151 -0
  13. package/esm/connection/1_connection_tcp.d.ts.map +1 -1
  14. package/esm/connection/1_connection_tcp.js +21 -52
  15. package/esm/connection/1_connection_tls.d.ts +33 -0
  16. package/esm/connection/1_connection_tls.d.ts.map +1 -0
  17. package/esm/connection/1_connection_tls.js +203 -0
  18. package/esm/deps/jsr.io/@std/io/0.225.3/write_all.d.ts +52 -0
  19. package/esm/deps/jsr.io/@std/io/0.225.3/write_all.d.ts.map +1 -0
  20. package/esm/deps/jsr.io/@std/io/0.225.3/write_all.js +61 -0
  21. package/esm/session/2_session_encrypted.d.ts.map +1 -1
  22. package/esm/session/2_session_encrypted.js +4 -1
  23. package/esm/transport/0_obfuscation.d.ts +5 -1
  24. package/esm/transport/0_obfuscation.d.ts.map +1 -1
  25. package/esm/transport/0_obfuscation.js +17 -4
  26. package/esm/transport/1_transport_intermediate.d.ts +7 -1
  27. package/esm/transport/1_transport_intermediate.d.ts.map +1 -1
  28. package/esm/transport/1_transport_intermediate.js +17 -7
  29. package/esm/transport/2_transport_provider_mtproxy.d.ts +23 -0
  30. package/esm/transport/2_transport_provider_mtproxy.d.ts.map +1 -0
  31. package/esm/transport/2_transport_provider_mtproxy.js +51 -0
  32. package/esm/transport/2_transport_provider_web_socket.js +1 -1
  33. package/esm/utilities/1_crypto.d.ts +1 -0
  34. package/esm/utilities/1_crypto.d.ts.map +1 -1
  35. package/esm/utilities/1_crypto.js +4 -0
  36. package/package.json +1 -1
  37. package/script/0_deps.d.ts +2 -2
  38. package/script/0_deps.d.ts.map +1 -1
  39. package/script/0_deps.js +4 -3
  40. package/script/2_connection.d.ts +2 -0
  41. package/script/2_connection.d.ts.map +1 -1
  42. package/script/2_connection.js +2 -0
  43. package/script/3_transport.d.ts +1 -0
  44. package/script/3_transport.d.ts.map +1 -1
  45. package/script/3_transport.js +1 -0
  46. package/script/connection/0_get_tls_header.d.ts +2 -0
  47. package/script/connection/0_get_tls_header.d.ts.map +1 -0
  48. package/script/connection/0_get_tls_header.js +154 -0
  49. package/script/connection/1_connection_tcp.d.ts.map +1 -1
  50. package/script/connection/1_connection_tcp.js +21 -52
  51. package/script/connection/1_connection_tls.d.ts +33 -0
  52. package/script/connection/1_connection_tls.d.ts.map +1 -0
  53. package/script/connection/1_connection_tls.js +207 -0
  54. package/script/deps/jsr.io/@std/io/0.225.3/write_all.d.ts +52 -0
  55. package/script/deps/jsr.io/@std/io/0.225.3/write_all.d.ts.map +1 -0
  56. package/script/deps/jsr.io/@std/io/0.225.3/write_all.js +65 -0
  57. package/script/session/2_session_encrypted.d.ts.map +1 -1
  58. package/script/session/2_session_encrypted.js +4 -1
  59. package/script/transport/0_obfuscation.d.ts +5 -1
  60. package/script/transport/0_obfuscation.d.ts.map +1 -1
  61. package/script/transport/0_obfuscation.js +16 -3
  62. package/script/transport/1_transport_intermediate.d.ts +7 -1
  63. package/script/transport/1_transport_intermediate.d.ts.map +1 -1
  64. package/script/transport/1_transport_intermediate.js +16 -6
  65. package/script/transport/2_transport_provider_mtproxy.d.ts +23 -0
  66. package/script/transport/2_transport_provider_mtproxy.d.ts.map +1 -0
  67. package/script/transport/2_transport_provider_mtproxy.js +54 -0
  68. package/script/transport/2_transport_provider_web_socket.js +1 -1
  69. package/script/utilities/1_crypto.d.ts +1 -0
  70. package/script/utilities/1_crypto.d.ts.map +1 -1
  71. package/script/utilities/1_crypto.js +5 -0
  72. package/esm/deps/jsr.io/@std/io/0.225.3/_constants.d.ts +0 -3
  73. package/esm/deps/jsr.io/@std/io/0.225.3/_constants.d.ts.map +0 -1
  74. package/esm/deps/jsr.io/@std/io/0.225.3/_constants.js +0 -4
  75. package/esm/deps/jsr.io/@std/io/0.225.3/iterate_reader.d.ts +0 -80
  76. package/esm/deps/jsr.io/@std/io/0.225.3/iterate_reader.d.ts.map +0 -1
  77. package/esm/deps/jsr.io/@std/io/0.225.3/iterate_reader.js +0 -96
  78. package/script/deps/jsr.io/@std/io/0.225.3/_constants.d.ts +0 -3
  79. package/script/deps/jsr.io/@std/io/0.225.3/_constants.d.ts.map +0 -1
  80. package/script/deps/jsr.io/@std/io/0.225.3/_constants.js +0 -7
  81. package/script/deps/jsr.io/@std/io/0.225.3/iterate_reader.d.ts +0 -80
  82. package/script/deps/jsr.io/@std/io/0.225.3/iterate_reader.d.ts.map +0 -1
  83. package/script/deps/jsr.io/@std/io/0.225.3/iterate_reader.js +0 -100
@@ -0,0 +1,52 @@
1
+ import type { Writer, WriterSync } from "./types.js";
2
+ export type { Writer, WriterSync } from "./types.js";
3
+ /**
4
+ * Write all the content of the array buffer (`arr`) to the writer (`w`).
5
+ *
6
+ * @example Writing to stdout
7
+ * ```ts no-assert
8
+ * import { writeAll } from "@std/io/write-all";
9
+ *
10
+ * const contentBytes = new TextEncoder().encode("Hello World");
11
+ * await writeAll(Deno.stdout, contentBytes);
12
+ * ```
13
+ *
14
+ * @example Writing to file
15
+ * ```ts ignore no-assert
16
+ * import { writeAll } from "@std/io/write-all";
17
+ *
18
+ * const contentBytes = new TextEncoder().encode("Hello World");
19
+ * using file = await Deno.open('test.file', { write: true });
20
+ * await writeAll(file, contentBytes);
21
+ * ```
22
+ *
23
+ * @param writer The writer to write to
24
+ * @param data The data to write
25
+ */
26
+ export declare function writeAll(writer: Writer, data: Uint8Array): Promise<void>;
27
+ /**
28
+ * Synchronously write all the content of the array buffer (`arr`) to the
29
+ * writer (`w`).
30
+ *
31
+ * @example "riting to stdout
32
+ * ```ts no-assert
33
+ * import { writeAllSync } from "@std/io/write-all";
34
+ *
35
+ * const contentBytes = new TextEncoder().encode("Hello World");
36
+ * writeAllSync(Deno.stdout, contentBytes);
37
+ * ```
38
+ *
39
+ * @example Writing to file
40
+ * ```ts ignore no-assert
41
+ * import { writeAllSync } from "@std/io/write-all";
42
+ *
43
+ * const contentBytes = new TextEncoder().encode("Hello World");
44
+ * using file = Deno.openSync("test.file", { write: true });
45
+ * writeAllSync(file, contentBytes);
46
+ * ```
47
+ *
48
+ * @param writer The writer to write to
49
+ * @param data The data to write
50
+ */
51
+ export declare function writeAllSync(writer: WriterSync, data: Uint8Array): void;
52
+ //# sourceMappingURL=write_all.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write_all.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.225.3/write_all.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,iBAK9D;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,QAKhE"}
@@ -0,0 +1,61 @@
1
+ // Copyright 2018-2026 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ /**
4
+ * Write all the content of the array buffer (`arr`) to the writer (`w`).
5
+ *
6
+ * @example Writing to stdout
7
+ * ```ts no-assert
8
+ * import { writeAll } from "@std/io/write-all";
9
+ *
10
+ * const contentBytes = new TextEncoder().encode("Hello World");
11
+ * await writeAll(Deno.stdout, contentBytes);
12
+ * ```
13
+ *
14
+ * @example Writing to file
15
+ * ```ts ignore no-assert
16
+ * import { writeAll } from "@std/io/write-all";
17
+ *
18
+ * const contentBytes = new TextEncoder().encode("Hello World");
19
+ * using file = await Deno.open('test.file', { write: true });
20
+ * await writeAll(file, contentBytes);
21
+ * ```
22
+ *
23
+ * @param writer The writer to write to
24
+ * @param data The data to write
25
+ */
26
+ export async function writeAll(writer, data) {
27
+ let nwritten = 0;
28
+ while (nwritten < data.length) {
29
+ nwritten += await writer.write(data.subarray(nwritten));
30
+ }
31
+ }
32
+ /**
33
+ * Synchronously write all the content of the array buffer (`arr`) to the
34
+ * writer (`w`).
35
+ *
36
+ * @example "riting to stdout
37
+ * ```ts no-assert
38
+ * import { writeAllSync } from "@std/io/write-all";
39
+ *
40
+ * const contentBytes = new TextEncoder().encode("Hello World");
41
+ * writeAllSync(Deno.stdout, contentBytes);
42
+ * ```
43
+ *
44
+ * @example Writing to file
45
+ * ```ts ignore no-assert
46
+ * import { writeAllSync } from "@std/io/write-all";
47
+ *
48
+ * const contentBytes = new TextEncoder().encode("Hello World");
49
+ * using file = Deno.openSync("test.file", { write: true });
50
+ * writeAllSync(file, contentBytes);
51
+ * ```
52
+ *
53
+ * @param writer The writer to write to
54
+ * @param data The data to write
55
+ */
56
+ export function writeAllSync(writer, data) {
57
+ let nwritten = 0;
58
+ while (nwritten < data.length) {
59
+ nwritten += writer.writeSync(data.subarray(nwritten));
60
+ }
61
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"2_session_encrypted.d.ts","sourceRoot":"","sources":["../../src/session/2_session_encrypted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAwD,OAAO,EAAuC,MAAM,YAAY,CAAC;AAChI,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAI5C,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,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K,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAa7D,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC;IAC5D,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxD;AAED,qBAAa,gBAAiB,SAAQ,OAAQ,YAAW,OAAO;;IAI9D,QAAQ,EAAE,QAAQ,CAAM;gBAiBZ,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,aAAa;IAQpC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC;IAM7C,IAAI,OAAO,IAAI,UAAU,CAAC,WAAW,CAAC,CAErC;IAEc,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAe9B,UAAU,IAAI,IAAI;IA6ErB,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CA4X3D"}
@@ -190,10 +190,13 @@ export class SessionEncrypted extends Session {
190
190
  return messageWriter.buffer;
191
191
  }
192
192
  async #decryptMessage(buffer) {
193
- const reader = new TLReader(buffer);
193
+ let reader = new TLReader(buffer);
194
194
  assertEquals(reader.readInt64(), this.#authKeyId);
195
195
  const messageKey_ = reader.readInt128();
196
196
  const messageKey = intToBytes(messageKey_, 16);
197
+ if (reader.buffer.length % 16 !== 0) {
198
+ reader = new TLReader(reader.buffer.subarray(0, -(reader.buffer.length % 16)));
199
+ }
197
200
  const a = await sha256(concat([messageKey, this.#authKey.subarray(8, 44)]));
198
201
  const b = await sha256(concat([this.#authKey.subarray(48, 84), messageKey]));
199
202
  const aesKey = concat([a.subarray(0, 8), b.subarray(8, 24), a.subarray(24, 32)]);
@@ -19,7 +19,11 @@
19
19
  */
20
20
  import { CTR } from "../1_utilities.js";
21
21
  import type { Connection } from "../2_connection.js";
22
- export declare function getObfuscationParameters(protocol: number, connection: Connection): Promise<{
22
+ export interface GetObfuscationParametersParams {
23
+ dcId?: number;
24
+ secret?: Uint8Array;
25
+ }
26
+ export declare function getObfuscationParameters(protocol: number, connection: Connection, params?: GetObfuscationParametersParams): Promise<{
23
27
  encryptionCTR: CTR;
24
28
  decryptionCTR: CTR;
25
29
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"0_obfuscation.d.ts","sourceRoot":"","sources":["../../src/transport/0_obfuscation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAc,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU;;;GA0CtF"}
1
+ {"version":3,"file":"0_obfuscation.d.ts","sourceRoot":"","sources":["../../src/transport/0_obfuscation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAsB,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,8BAA8B;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,8BAA8B;;;GAyD/H"}
@@ -18,8 +18,8 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import { concat } from "../0_deps.js";
21
- import { CTR, intToBytes } from "../1_utilities.js";
22
- export async function getObfuscationParameters(protocol, connection) {
21
+ import { CTR, intToBytes, sha256 } from "../1_utilities.js";
22
+ export async function getObfuscationParameters(protocol, connection, params) {
23
23
  let init;
24
24
  while (true) {
25
25
  init = concat([crypto.getRandomValues(new Uint8Array(56)), intToBytes(protocol, 4, { byteOrder: "big", isSigned: false }), crypto.getRandomValues(new Uint8Array(4))]);
@@ -37,14 +37,27 @@ export async function getObfuscationParameters(protocol, connection) {
37
37
  }
38
38
  break;
39
39
  }
40
- const encryptKey = init.slice(8, 8 + 32);
40
+ if (params?.dcId !== undefined) {
41
+ init.set(intToBytes(params.dcId, 2, { byteOrder: "little" }), 60);
42
+ }
43
+ let secret = params?.secret;
44
+ if (secret !== undefined && secret.byteLength >= 17) {
45
+ secret = secret.subarray(1, 17);
46
+ }
47
+ let encryptKey = init.slice(8, 8 + 32);
41
48
  const encryptIv = init.slice(40, 40 + 16);
49
+ if (secret) {
50
+ encryptKey = await sha256(concat([encryptKey, secret]));
51
+ }
42
52
  const importedEncryptedKey = await CTR.importKey(encryptKey);
43
53
  const encryptionCTR = new CTR(importedEncryptedKey, encryptIv);
44
54
  const encryptedInit = await encryptionCTR.call(init);
45
55
  const initRev = new Uint8Array(init).reverse();
46
- const decryptKey = initRev.slice(8, 8 + 32);
56
+ let decryptKey = initRev.slice(8, 8 + 32);
47
57
  const decryptIv = initRev.slice(40, 40 + 16);
58
+ if (secret) {
59
+ decryptKey = await sha256(concat([decryptKey, secret]));
60
+ }
48
61
  const importedDecryptKey = await CTR.importKey(decryptKey);
49
62
  const decryptionCTR = new CTR(importedDecryptKey, decryptIv);
50
63
  await connection.write(concat([init.subarray(0, 56), encryptedInit.subarray(56, 56 + 8)]));
@@ -19,9 +19,15 @@
19
19
  */
20
20
  import type { Connection } from "../2_connection.js";
21
21
  import { Transport } from "./0_transport.js";
22
+ export interface TransportIntermediateParams {
23
+ isObfuscated?: boolean;
24
+ isPadded?: boolean;
25
+ dcId?: number;
26
+ secret?: Uint8Array;
27
+ }
22
28
  export declare class TransportIntermediate extends Transport implements Transport {
23
29
  #private;
24
- constructor(connection: Connection, obfuscated?: boolean);
30
+ constructor(connection: Connection, params?: TransportIntermediateParams);
25
31
  initialize(): Promise<void>;
26
32
  receive(): Promise<Uint8Array>;
27
33
  send(buffer: Uint8Array): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"1_transport_intermediate.d.ts","sourceRoot":"","sources":["../../src/transport/1_transport_intermediate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBAAa,qBAAsB,SAAQ,SAAU,YAAW,SAAS;;gBAI3D,UAAU,EAAE,UAAU,EAAE,UAAU,UAAQ;IAMhD,UAAU;IAQV,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IAiB9B,IAAI,CAAC,MAAM,EAAE,UAAU;CAM9B"}
1
+ {"version":3,"file":"1_transport_intermediate.d.ts","sourceRoot":"","sources":["../../src/transport/1_transport_intermediate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,WAAW,2BAA2B;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,qBAAa,qBAAsB,SAAQ,SAAU,YAAW,SAAS;;gBAO3D,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,2BAA2B;IASlE,UAAU;IAYV,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IAiB9B,IAAI,CAAC,MAAM,EAAE,UAAU;CAW9B"}
@@ -18,23 +18,29 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import { concat } from "../0_deps.js";
21
- import { intToBytes } from "../1_utilities.js";
21
+ import { getRandomId, intToBytes } from "../1_utilities.js";
22
22
  import { getObfuscationParameters } from "./0_obfuscation.js";
23
23
  import { Transport } from "./0_transport.js";
24
24
  export class TransportIntermediate extends Transport {
25
25
  #connection;
26
- #obfuscated;
27
- constructor(connection, obfuscated = false) {
26
+ #isObfuscated;
27
+ #isPadded;
28
+ #dcId;
29
+ #secret;
30
+ constructor(connection, params) {
28
31
  super();
29
32
  this.#connection = connection;
30
- this.#obfuscated = obfuscated;
33
+ this.#isObfuscated = params?.isObfuscated ?? false;
34
+ this.#isPadded = params?.isPadded ?? false;
35
+ this.#dcId = params?.dcId;
36
+ this.#secret = params?.secret;
31
37
  }
32
38
  async initialize() {
33
- if (this.#obfuscated) {
34
- this.obfuscationParameters = await getObfuscationParameters(0xEEEEEEEE, this.#connection);
39
+ if (this.#isObfuscated) {
40
+ this.obfuscationParameters = await getObfuscationParameters(this.#isPadded ? 0xDDDDDDDD : 0xEEEEEEEE, this.#connection, { dcId: this.#dcId, secret: this.#secret });
35
41
  }
36
42
  else {
37
- await this.#connection.write(new Uint8Array([0xEE, 0xEE, 0xEE, 0xEE]));
43
+ await this.#connection.write(new Uint8Array(this.#isPadded ? [0xDD, 0xDD, 0xDD, 0xDD] : [0xEE, 0xEE, 0xEE, 0xEE]));
38
44
  }
39
45
  }
40
46
  async receive() {
@@ -51,6 +57,10 @@ export class TransportIntermediate extends Transport {
51
57
  return await this.decrypt(buffer);
52
58
  }
53
59
  async send(buffer) {
60
+ if (this.#isPadded) {
61
+ const padding = crypto.getRandomValues(new Uint8Array(Math.abs(getRandomId(true) % 16)));
62
+ buffer = concat([buffer, padding]);
63
+ }
54
64
  const length = intToBytes(buffer.length, 4);
55
65
  const data = concat([length, buffer]);
56
66
  await this.#connection.write(await this.encrypt(data));
@@ -0,0 +1,23 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import { type TransportProvider } from "./1_transport_provider.js";
21
+ export declare function transportProviderMtproxy(link: string): TransportProvider;
22
+ export declare function transportProviderMtproxy(hostname: string, port: number, secret: Uint8Array<ArrayBuffer>): TransportProvider;
23
+ //# sourceMappingURL=2_transport_provider_mtproxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2_transport_provider_mtproxy.d.ts","sourceRoot":"","sources":["../../src/transport/2_transport_provider_mtproxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,EAAW,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE5E,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC;AAC1E,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import { decodeHex } from "../0_deps.js";
21
+ import { ConnectionTCP } from "../connection/1_connection_tcp.js";
22
+ import { ConnectionTLS } from "../connection/1_connection_tls.js";
23
+ import { TransportIntermediate } from "./1_transport_intermediate.js";
24
+ import { getDcId } from "./1_transport_provider.js";
25
+ export function transportProviderMtproxy(hostnameOrLink, port, secret) {
26
+ let hostname = hostnameOrLink;
27
+ if (port === undefined && secret === undefined) {
28
+ const url = new URL(hostnameOrLink);
29
+ const hostname_ = url.searchParams.get("server");
30
+ const port_ = url.searchParams.get("port");
31
+ const secret_ = url.searchParams.get("secret");
32
+ if (!hostname_ || !port_ || !secret_) {
33
+ throw new TypeError("Invalid MTProxy link.");
34
+ }
35
+ hostname = hostname_;
36
+ port = parseInt(port_);
37
+ secret = decodeHex(secret_);
38
+ if (isNaN(port) || port < 0 || port > 0xFFFF) {
39
+ throw new TypeError("Server port is invalid.");
40
+ }
41
+ if (secret.byteLength < 16) {
42
+ throw new TypeError("Proxy secret must be at least 16 bytes.");
43
+ }
44
+ }
45
+ return ({ dc, isCdn }) => {
46
+ const dcId = getDcId(dc, isCdn);
47
+ const connection = secret.byteLength <= 17 ? new ConnectionTCP(hostname, port) : new ConnectionTLS(hostname, port, secret);
48
+ const transport = new TransportIntermediate(connection, { isPadded: true, isObfuscated: true, secret, dcId });
49
+ return { connection, transport, dcId };
50
+ };
51
+ }
@@ -36,8 +36,8 @@ export const transportProviderWebSocket = (params) => {
36
36
  params.wss ??= typeof location !== "undefined" && location.protocol === "http:" && location.hostname !== "localhost" ? false : true;
37
37
  const url = `${params.wss ? "wss" : "ws"}://${dcToNameMap[dc]}${isCdn ? "-1" : ""}.web.telegram.org/${dc.endsWith("-test") ? "apiws_test" : "apiws"}`;
38
38
  const connection = new ConnectionWebSocket(url);
39
- const transport = new TransportIntermediate(connection, true);
40
39
  const dcId = getDcId(dc, isCdn);
40
+ const transport = new TransportIntermediate(connection, { isObfuscated: true, dcId });
41
41
  return { connection, transport, dcId };
42
42
  };
43
43
  };
@@ -27,4 +27,5 @@ export declare class CTR {
27
27
  static importKey(key: Uint8Array<ArrayBuffer>): Promise<CryptoKey>;
28
28
  call(data: Uint8Array<ArrayBuffer>): Promise<Uint8Array<ArrayBuffer>>;
29
29
  }
30
+ export declare function hmacSha256(data: Uint8Array<ArrayBuffer>, secret: Uint8Array<ArrayBuffer>): Promise<Uint8Array<ArrayBuffer>>;
30
31
  //# sourceMappingURL=1_crypto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"1_crypto.d.ts","sourceRoot":"","sources":["../../src/utilities/1_crypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,qBAAa,GAAG;;IAMd,IAAI,MAAM,IAAI;QAAE,EAAE,EAAE,UAAU,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAE9C;gBAEW,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU;WAK7B,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;IAIlE,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;CAkD5E"}
1
+ {"version":3,"file":"1_crypto.d.ts","sourceRoot":"","sources":["../../src/utilities/1_crypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,qBAAa,GAAG;;IAMd,IAAI,MAAM,IAAI;QAAE,EAAE,EAAE,UAAU,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAE9C;gBAEW,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU;WAK7B,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;IAIlE,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;CAkD5E;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC,oCAe9F"}
@@ -77,3 +77,7 @@ export class CTR {
77
77
  this.#iv = intToBytes(intFromBytes(this.#iv, { byteOrder: "big", isSigned: false }) + BigInt(amount), this.#iv.length, { byteOrder: "big", isSigned: false });
78
78
  }
79
79
  }
80
+ export async function hmacSha256(data, secret) {
81
+ const key = await crypto.subtle.importKey("raw", secret, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
82
+ return new Uint8Array(await crypto.subtle.sign("HMAC", key, data.buffer));
83
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mtkruto/browser",
3
- "version": "0.132.0",
3
+ "version": "0.133.0",
4
4
  "description": "MTKruto for browsers",
5
5
  "author": "Roj <rojvv@icloud.com>",
6
6
  "repository": {
@@ -33,11 +33,11 @@ export { concat } from "./deps/jsr.io/@std/bytes/1.0.6/concat.js";
33
33
  export { equals } from "./deps/jsr.io/@std/bytes/1.0.6/equals.js";
34
34
  export { startsWith } from "./deps/jsr.io/@std/bytes/1.0.6/starts_with.js";
35
35
  export { LruCache } from "./deps/jsr.io/@std/cache/0.2.2/lru_cache.js";
36
- export { iterateReader } from "./deps/jsr.io/@std/io/0.225.3/iterate_reader.js";
36
+ export { writeAll } from "./deps/jsr.io/@std/io/0.225.3/write_all.js";
37
37
  export { format } from "./deps/jsr.io/@std/datetime/0.225.7/format.js";
38
38
  export { MINUTE, SECOND } from "./deps/jsr.io/@std/datetime/0.225.7/constants.js";
39
39
  export { toArrayBuffer } from "./deps/jsr.io/@std/streams/1.0.17/to_array_buffer.js";
40
- export { encodeHex } from "./deps/jsr.io/@std/encoding/1.0.10/hex.js";
40
+ export { decodeHex, encodeHex } from "./deps/jsr.io/@std/encoding/1.0.10/hex.js";
41
41
  export { decodeBase64, encodeBase64 } from "./deps/jsr.io/@std/encoding/1.0.10/base64.js";
42
42
  import { contentType as contentType_ } from "./deps/jsr.io/@std/media-types/1.1.0/content_type.js";
43
43
  export declare const contentType: typeof contentType_;
@@ -1 +1 @@
1
- {"version":3,"file":"0_deps.d.ts","sourceRoot":"","sources":["../src/0_deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAErF,OAAO,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,0CAA0C,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8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AAC"}
package/script/0_deps.js CHANGED
@@ -19,7 +19,7 @@
19
19
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
20
  */
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.initTgCrypto = exports.ige256Encrypt = exports.ige256Decrypt = exports.contentType = exports.encodeBase64 = exports.decodeBase64 = exports.encodeHex = exports.toArrayBuffer = exports.SECOND = exports.MINUTE = exports.format = exports.iterateReader = exports.LruCache = exports.startsWith = exports.equals = exports.concat = exports.pooledMap = exports.delay = exports.isAbsolute = exports.toFileUrl = exports.basename = exports.extname = exports.join = exports.AssertionError = exports.unreachable = exports.assertEquals = exports.assertFalse = exports.assert = void 0;
22
+ exports.initTgCrypto = exports.ige256Encrypt = exports.ige256Decrypt = exports.contentType = exports.encodeBase64 = exports.decodeBase64 = exports.encodeHex = exports.decodeHex = exports.toArrayBuffer = exports.SECOND = exports.MINUTE = exports.format = exports.writeAll = exports.LruCache = exports.startsWith = exports.equals = exports.concat = exports.pooledMap = exports.delay = exports.isAbsolute = exports.toFileUrl = exports.basename = exports.extname = exports.join = exports.AssertionError = exports.unreachable = exports.assertEquals = exports.assertFalse = exports.assert = void 0;
23
23
  exports.extension = extension;
24
24
  var assert_js_1 = require("./deps/jsr.io/@std/assert/1.0.19/assert.js");
25
25
  Object.defineProperty(exports, "assert", { enumerable: true, get: function () { return assert_js_1.assert; } });
@@ -53,8 +53,8 @@ var starts_with_js_1 = require("./deps/jsr.io/@std/bytes/1.0.6/starts_with.js");
53
53
  Object.defineProperty(exports, "startsWith", { enumerable: true, get: function () { return starts_with_js_1.startsWith; } });
54
54
  var lru_cache_js_1 = require("./deps/jsr.io/@std/cache/0.2.2/lru_cache.js");
55
55
  Object.defineProperty(exports, "LruCache", { enumerable: true, get: function () { return lru_cache_js_1.LruCache; } });
56
- var iterate_reader_js_1 = require("./deps/jsr.io/@std/io/0.225.3/iterate_reader.js");
57
- Object.defineProperty(exports, "iterateReader", { enumerable: true, get: function () { return iterate_reader_js_1.iterateReader; } });
56
+ var write_all_js_1 = require("./deps/jsr.io/@std/io/0.225.3/write_all.js");
57
+ Object.defineProperty(exports, "writeAll", { enumerable: true, get: function () { return write_all_js_1.writeAll; } });
58
58
  var format_js_1 = require("./deps/jsr.io/@std/datetime/0.225.7/format.js");
59
59
  Object.defineProperty(exports, "format", { enumerable: true, get: function () { return format_js_1.format; } });
60
60
  var constants_js_1 = require("./deps/jsr.io/@std/datetime/0.225.7/constants.js");
@@ -63,6 +63,7 @@ Object.defineProperty(exports, "SECOND", { enumerable: true, get: function () {
63
63
  var to_array_buffer_js_1 = require("./deps/jsr.io/@std/streams/1.0.17/to_array_buffer.js");
64
64
  Object.defineProperty(exports, "toArrayBuffer", { enumerable: true, get: function () { return to_array_buffer_js_1.toArrayBuffer; } });
65
65
  var hex_js_1 = require("./deps/jsr.io/@std/encoding/1.0.10/hex.js");
66
+ Object.defineProperty(exports, "decodeHex", { enumerable: true, get: function () { return hex_js_1.decodeHex; } });
66
67
  Object.defineProperty(exports, "encodeHex", { enumerable: true, get: function () { return hex_js_1.encodeHex; } });
67
68
  var base64_js_1 = require("./deps/jsr.io/@std/encoding/1.0.10/base64.js");
68
69
  Object.defineProperty(exports, "decodeBase64", { enumerable: true, get: function () { return base64_js_1.decodeBase64; } });
@@ -18,5 +18,7 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  export * from "./connection/0_connection.js";
21
+ export * from "./connection/1_connection_tcp.js";
22
+ export * from "./connection/1_connection_tls.js";
21
23
  export * from "./connection/1_connection_web_socket.js";
22
24
  //# sourceMappingURL=2_connection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"2_connection.d.ts","sourceRoot":"","sources":["../src/2_connection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yCAAyC,CAAC"}
1
+ {"version":3,"file":"2_connection.d.ts","sourceRoot":"","sources":["../src/2_connection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC"}
@@ -34,4 +34,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
34
34
  };
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  __exportStar(require("./connection/0_connection.js"), exports);
37
+ __exportStar(require("./connection/1_connection_tcp.js"), exports);
38
+ __exportStar(require("./connection/1_connection_tls.js"), exports);
37
39
  __exportStar(require("./connection/1_connection_web_socket.js"), exports);
@@ -21,6 +21,7 @@ export * from "./transport/0_transport.js";
21
21
  export * from "./transport/1_transport_abridged.js";
22
22
  export * from "./transport/1_transport_intermediate.js";
23
23
  export * from "./transport/1_transport_provider.js";
24
+ export * from "./transport/2_transport_provider_mtproxy.js";
24
25
  export * from "./transport/2_transport_provider_tcp.js";
25
26
  export * from "./transport/2_transport_provider_web_socket.js";
26
27
  //# sourceMappingURL=3_transport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"3_transport.d.ts","sourceRoot":"","sources":["../src/3_transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC"}
1
+ {"version":3,"file":"3_transport.d.ts","sourceRoot":"","sources":["../src/3_transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC"}
@@ -37,5 +37,6 @@ __exportStar(require("./transport/0_transport.js"), exports);
37
37
  __exportStar(require("./transport/1_transport_abridged.js"), exports);
38
38
  __exportStar(require("./transport/1_transport_intermediate.js"), exports);
39
39
  __exportStar(require("./transport/1_transport_provider.js"), exports);
40
+ __exportStar(require("./transport/2_transport_provider_mtproxy.js"), exports);
40
41
  __exportStar(require("./transport/2_transport_provider_tcp.js"), exports);
41
42
  __exportStar(require("./transport/2_transport_provider_web_socket.js"), exports);
@@ -0,0 +1,2 @@
1
+ export declare function getTlsHeader(secret: Uint8Array<ArrayBuffer>): Promise<Uint8Array<ArrayBuffer>>;
2
+ //# sourceMappingURL=0_get_tls_header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0_get_tls_header.d.ts","sourceRoot":"","sources":["../../src/connection/0_get_tls_header.ts"],"names":[],"mappings":"AAGA,wBAAsB,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC,oCASjE"}