Skip to content

Commit 71ed1bd

Browse files
committed
revise tlsPlainText
1 parent f6d7db6 commit 71ed1bd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tls/enum",
3-
"version": "0.4.8",
3+
"version": "0.4.9",
44
"exports": "./src/mod.ts",
55
"publish": {
66
"exclude": ["dist/"]

src/contentype.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import { Uint8, Uint16, Struct } from "./dep.ts";
55
import { Enum } from "./enum.js";
6+
import { HandshakeType } from "./handshaketype.js";
67
import { Version } from "./version.js";
78

89
/**
@@ -36,10 +37,10 @@ export class ContentType extends Enum {
3637
/**return 8 */
3738
get bit() { return 8 }
3839

39-
tlsPlainText(fragment) {
40+
tlsPlaintext(fragment) {
4041
return TLSPlaintext.createFrom(
4142
this,
42-
Version.TLS13,
43+
fragment.msg_type == HandshakeType.CLIENT_HELLO ? Version.legacy: Version.TLS12,
4344
fragment
4445
)
4546
}

type/contentype.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class ContentType extends Enum {
5353
* @param {Uint8Array} fragment - The plaintext fragment to include.
5454
* @returns {TLSPlaintext} A TLSPlaintext object created with the specified parameters.
5555
*/
56-
tlsPlainText(fragment: Uint8Array): TLSPlaintext;
56+
tlsPlaintext(fragment: Uint8Array): TLSPlaintext;
5757

5858
/**
5959
* Creates a `TLSInnerPlaintext` instance from content and zero padding.

0 commit comments

Comments
 (0)