Skip to content

Commit 1183fb8

Browse files
committed
add more complete of ExtensionType and SignatureScheme
1 parent a87f824 commit 1183fb8

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
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.8.4",
3+
"version": "0.8.5",
44
"exports": "./src/mod.ts",
55
"publish": {
66
"exclude": ["dist/"]

src/extensiontype.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ export class ExtensionType extends Enum {
190190
*/
191191
static RENEGOTIATION_INFO = new ExtensionType("RENEGOTIATION_INFO", 65281);
192192

193+
static EC_POINT_FORMAT = new ExtensionType("EC_POINT_FORMAT", 11);
194+
static ENCRYPTED_THEN_MAC = new ExtensionType("ENCRYPTED_THEN_MAC", 22);
195+
static EXTENDED_MASTER_SECRET = new ExtensionType("EXTENDED_MASTER_SECRET", 23);
196+
193197
/**
194198
* check octet and return ExtensionType
195199
*

src/signaturescheme.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ export class SignatureScheme extends Enum {
4848
static PRIVATE_USE = new SignatureScheme('PRIVATE_USE', 0xFFFF);
4949
*/
5050

51+
static ecdsa_brainpoolP256r1_sha256 = new SignatureScheme('ecdsa_brainpoolP256r1_sha256', 0x081a);
52+
static ecdsa_brainpoolP384r1_sha384 = new SignatureScheme('ecdsa_brainpoolP384r1_sha384', 0x081b);
53+
static ecdsa_brainpoolP512r1_sha512 = new SignatureScheme('ecdsa_brainpoolP512r1_sha512', 0x081c);
54+
5155
/**
5256
* Parses an octet array and returns a valid SignatureScheme.
5357
*

test/extensiontype_test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
import { HexaDecimal } from "../src/dep.ts";
12
import { ExtensionType } from "../src/extensiontype.js";
23

4+
const decoder = new TextDecoder
5+
36
const codes = [1, 5, 10, 13, 14, 15, 16, 18, 19, 20, 21, 41, 42, 43, 44, 45, 47, 48, 49, 50, 51, 65281]
47
for (const e of codes) {
58
const parse = ExtensionType.from(new Uint8Array([Math.floor(e / 256), e % 256]))
69
console.log(`name: ${parse.name} value: ${parse.value}`)
710
}
11+

0 commit comments

Comments
 (0)