Skip to content

Commit dedc8c5

Browse files
committed
add fragment, handshake to ClientHello and ServerHello
1 parent 7b77ee0 commit dedc8c5

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

deno.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tls/keyexchange",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"exports": "./src/mod.ts",
55
"publish": {
66
"exclude": ["dist/"]
@@ -15,7 +15,7 @@
1515
"imports": {
1616
"@std/assert": "jsr:@std/assert@^1.0.2",
1717
"@tls/enum": "jsr:@tls/enum@^0.8.7",
18-
"@tls/extension": "jsr:@tls/extension@^0.4.5",
18+
"@tls/extension": "jsr:@tls/extension@^0.4.6",
1919
"@tls/struct": "jsr:@tls/struct@^0.3.8"
2020
}
2121
}

deno.lock

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/clienthello.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,14 @@ export class ClientHello extends Uint8Array {
9999
get handshake(){
100100
const handshake = safeuint8array(1, Uint24.fromValue(this.length), this);
101101
handshake.groups = this.groups;
102+
handshake.message = this
102103
return handshake;
103104
}
104105
get record(){
105106
const handshake = this.handshake
106107
const record = safeuint8array(22, Version.TLS10.byte, Uint16.fromValue(handshake.length), handshake);
107108
record.groups = this.groups;
109+
record.fragment = handshake;
108110
return record
109111
}
110112
set groups(groups){

src/serverhello.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@ export class ServerHello extends Uint8Array {
6363
return this.#extensions
6464
}
6565
get handshake() {
66-
return safeuint8array(2, Uint24.fromValue(this.length), this)
66+
const handshake = safeuint8array(2, Uint24.fromValue(this.length), this)
67+
handshake.group = this.group;
68+
handshake.message = this;
69+
return handshake;
6770
}
6871
get record() {
6972
const handshake = this.handshake
70-
return safeuint8array(22, Version.legacy.byte, Uint16.fromValue(handshake.length), handshake)
73+
const record = safeuint8array(22, Version.legacy.byte, Uint16.fromValue(handshake.length), handshake)
74+
record.fragment = handshake;
75+
record.group = handshake.group;
76+
return record;
7177
}
7278
get isHRR() {
7379
return this.random.toString() == "207,33,173,116,229,154,97,17,190,29,140,2,30,101,184,145,194,162,17,22,122,187,140,94,7,158,9,226,200,168,51,156";

0 commit comments

Comments
 (0)