@php-wasm/web 1.0.3 → 1.0.5
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/index.js +2399 -234
- package/lib/index.d.ts +2 -0
- package/lib/load-runtime.d.ts +2 -2
- package/lib/tcp-over-fetch-websocket.d.ts +108 -0
- package/lib/tls/1_2/connection.d.ts +194 -0
- package/lib/tls/1_2/prf.d.ts +7 -0
- package/lib/tls/1_2/types.d.ts +223 -0
- package/lib/tls/certificates.d.ts +199 -0
- package/lib/tls/cipher-suites.d.ts +210 -0
- package/lib/tls/extensions/0_server_name.d.ts +33 -0
- package/lib/tls/extensions/10_supported_groups.d.ts +44 -0
- package/lib/tls/extensions/11_ec_point_formats.d.ts +45 -0
- package/lib/tls/extensions/13_signature_algorithms.d.ts +74 -0
- package/lib/tls/extensions/parse-extensions.d.ts +66 -0
- package/lib/tls/extensions/types.d.ts +62 -0
- package/lib/tls/utils.d.ts +28 -0
- package/package.json +6 -6
- package/php/asyncify/7_0_33/php_7_0.wasm +0 -0
- package/php/asyncify/7_1_30/php_7_1.wasm +0 -0
- package/php/asyncify/7_2_34/php_7_2.wasm +0 -0
- package/php/asyncify/7_3_33/php_7_3.wasm +0 -0
- package/php/asyncify/7_4_33/php_7_4.wasm +0 -0
- package/php/asyncify/8_0_30/php_8_0.wasm +0 -0
- package/php/asyncify/8_1_23/php_8_1.wasm +0 -0
- package/php/asyncify/8_2_10/php_8_2.wasm +0 -0
- package/php/asyncify/8_3_0/php_8_3.wasm +0 -0
- package/php/asyncify/php_7_0.js +3 -3
- package/php/asyncify/php_7_1.js +3 -3
- package/php/asyncify/php_7_2.js +3 -3
- package/php/asyncify/php_7_3.js +3 -3
- package/php/asyncify/php_7_4.js +3 -3
- package/php/asyncify/php_8_0.js +3 -3
- package/php/asyncify/php_8_1.js +3 -3
- package/php/asyncify/php_8_2.js +3 -3
- package/php/asyncify/php_8_3.js +3 -3
- package/php/jspi/7_0_33/php_7_0.wasm +0 -0
- package/php/jspi/7_1_30/php_7_1.wasm +0 -0
- package/php/jspi/7_2_34/php_7_2.wasm +0 -0
- package/php/jspi/7_3_33/php_7_3.wasm +0 -0
- package/php/jspi/7_4_33/php_7_4.wasm +0 -0
- package/php/jspi/8_0_30/php_8_0.wasm +0 -0
- package/php/jspi/8_1_23/php_8_1.wasm +0 -0
- package/php/jspi/8_2_10/php_8_2.wasm +0 -0
- package/php/jspi/8_3_0/php_8_3.wasm +0 -0
- package/php/jspi/php_7_0.js +2 -2
- package/php/jspi/php_7_1.js +2 -2
- package/php/jspi/php_7_2.js +2 -2
- package/php/jspi/php_7_3.js +2 -2
- package/php/jspi/php_7_4.js +2 -2
- package/php/jspi/php_8_0.js +2 -2
- package/php/jspi/php_8_1.js +2 -2
- package/php/jspi/php_8_2.js +2 -2
- package/php/jspi/php_8_3.js +2 -2
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates an X.509 certificate from the given description.
|
|
3
|
+
*
|
|
4
|
+
* If the issuer key pair is provided, the certificate will be signed
|
|
5
|
+
* using the provided issuer's private key. Otherwise, the certificate
|
|
6
|
+
* will be self-signed.
|
|
7
|
+
*
|
|
8
|
+
* The code below is underdocumented. The following links may provide
|
|
9
|
+
* more clarity about X.509, ASN.1, DER, PEM, and other data formats
|
|
10
|
+
* this module encodes:
|
|
11
|
+
*
|
|
12
|
+
* * https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/
|
|
13
|
+
* * https://dev.to/wayofthepie/structure-of-an-ssl-x-509-certificate-16b
|
|
14
|
+
* * https://www.oss.com/asn1/resources/asn1-made-simple/asn1-quick-reference/asn1-tags.html
|
|
15
|
+
*/
|
|
16
|
+
export declare function generateCertificate(description: TBSCertificateDescription, issuerKeyPair?: CryptoKeyPair): Promise<GeneratedCertificate>;
|
|
17
|
+
export declare function certificateToPEM(certificate: Uint8Array): string;
|
|
18
|
+
export declare function privateKeyToPEM(privateKey: CryptoKey): Promise<string>;
|
|
19
|
+
/**
|
|
20
|
+
* OIDs used in X.509 certificates.
|
|
21
|
+
*
|
|
22
|
+
* Source: https://oidref.com/
|
|
23
|
+
*/
|
|
24
|
+
declare const oids: {
|
|
25
|
+
readonly '1.2.840.113549.1.1.1': "rsaEncryption";
|
|
26
|
+
readonly '1.2.840.113549.1.1.4': "md5WithRSAEncryption";
|
|
27
|
+
readonly '1.2.840.113549.1.1.5': "sha1WithRSAEncryption";
|
|
28
|
+
readonly '1.2.840.113549.1.1.7': "RSAES-OAEP";
|
|
29
|
+
readonly '1.2.840.113549.1.1.8': "mgf1";
|
|
30
|
+
readonly '1.2.840.113549.1.1.9': "pSpecified";
|
|
31
|
+
readonly '1.2.840.113549.1.1.10': "RSASSA-PSS";
|
|
32
|
+
readonly '1.2.840.113549.1.1.11': "sha256WithRSAEncryption";
|
|
33
|
+
readonly '1.2.840.113549.1.1.12': "sha384WithRSAEncryption";
|
|
34
|
+
readonly '1.2.840.113549.1.1.13': "sha512WithRSAEncryption";
|
|
35
|
+
readonly '1.3.101.112': "EdDSA25519";
|
|
36
|
+
readonly '1.2.840.10040.4.3': "dsa-with-sha1";
|
|
37
|
+
readonly '1.3.14.3.2.7': "desCBC";
|
|
38
|
+
readonly '1.3.14.3.2.26': "sha1";
|
|
39
|
+
readonly '1.3.14.3.2.29': "sha1WithRSASignature";
|
|
40
|
+
readonly '2.16.840.1.101.3.4.2.1': "sha256";
|
|
41
|
+
readonly '2.16.840.1.101.3.4.2.2': "sha384";
|
|
42
|
+
readonly '2.16.840.1.101.3.4.2.3': "sha512";
|
|
43
|
+
readonly '2.16.840.1.101.3.4.2.4': "sha224";
|
|
44
|
+
readonly '2.16.840.1.101.3.4.2.5': "sha512-224";
|
|
45
|
+
readonly '2.16.840.1.101.3.4.2.6': "sha512-256";
|
|
46
|
+
readonly '1.2.840.113549.2.2': "md2";
|
|
47
|
+
readonly '1.2.840.113549.2.5': "md5";
|
|
48
|
+
readonly '1.2.840.113549.1.7.1': "data";
|
|
49
|
+
readonly '1.2.840.113549.1.7.2': "signedData";
|
|
50
|
+
readonly '1.2.840.113549.1.7.3': "envelopedData";
|
|
51
|
+
readonly '1.2.840.113549.1.7.4': "signedAndEnvelopedData";
|
|
52
|
+
readonly '1.2.840.113549.1.7.5': "digestedData";
|
|
53
|
+
readonly '1.2.840.113549.1.7.6': "encryptedData";
|
|
54
|
+
readonly '1.2.840.113549.1.9.1': "emailAddress";
|
|
55
|
+
readonly '1.2.840.113549.1.9.2': "unstructuredName";
|
|
56
|
+
readonly '1.2.840.113549.1.9.3': "contentType";
|
|
57
|
+
readonly '1.2.840.113549.1.9.4': "messageDigest";
|
|
58
|
+
readonly '1.2.840.113549.1.9.5': "signingTime";
|
|
59
|
+
readonly '1.2.840.113549.1.9.6': "counterSignature";
|
|
60
|
+
readonly '1.2.840.113549.1.9.7': "challengePassword";
|
|
61
|
+
readonly '1.2.840.113549.1.9.8': "unstructuredAddress";
|
|
62
|
+
readonly '1.2.840.113549.1.9.14': "extensionRequest";
|
|
63
|
+
readonly '1.2.840.113549.1.9.20': "friendlyName";
|
|
64
|
+
readonly '1.2.840.113549.1.9.21': "localKeyId";
|
|
65
|
+
readonly '1.2.840.113549.1.9.22.1': "x509Certificate";
|
|
66
|
+
readonly '1.2.840.113549.1.12.10.1.1': "keyBag";
|
|
67
|
+
readonly '1.2.840.113549.1.12.10.1.2': "pkcs8ShroudedKeyBag";
|
|
68
|
+
readonly '1.2.840.113549.1.12.10.1.3': "certBag";
|
|
69
|
+
readonly '1.2.840.113549.1.12.10.1.4': "crlBag";
|
|
70
|
+
readonly '1.2.840.113549.1.12.10.1.5': "secretBag";
|
|
71
|
+
readonly '1.2.840.113549.1.12.10.1.6': "safeContentsBag";
|
|
72
|
+
readonly '1.2.840.113549.1.5.13': "pkcs5PBES2";
|
|
73
|
+
readonly '1.2.840.113549.1.5.12': "pkcs5PBKDF2";
|
|
74
|
+
readonly '1.2.840.113549.1.12.1.1': "pbeWithSHAAnd128BitRC4";
|
|
75
|
+
readonly '1.2.840.113549.1.12.1.2': "pbeWithSHAAnd40BitRC4";
|
|
76
|
+
readonly '1.2.840.113549.1.12.1.3': "pbeWithSHAAnd3-KeyTripleDES-CBC";
|
|
77
|
+
readonly '1.2.840.113549.1.12.1.4': "pbeWithSHAAnd2-KeyTripleDES-CBC";
|
|
78
|
+
readonly '1.2.840.113549.1.12.1.5': "pbeWithSHAAnd128BitRC2-CBC";
|
|
79
|
+
readonly '1.2.840.113549.1.12.1.6': "pbewithSHAAnd40BitRC2-CBC";
|
|
80
|
+
readonly '1.2.840.113549.2.7': "hmacWithSHA1";
|
|
81
|
+
readonly '1.2.840.113549.2.8': "hmacWithSHA224";
|
|
82
|
+
readonly '1.2.840.113549.2.9': "hmacWithSHA256";
|
|
83
|
+
readonly '1.2.840.113549.2.10': "hmacWithSHA384";
|
|
84
|
+
readonly '1.2.840.113549.2.11': "hmacWithSHA512";
|
|
85
|
+
readonly '1.2.840.113549.3.7': "des-EDE3-CBC";
|
|
86
|
+
readonly '2.16.840.1.101.3.4.1.2': "aes128-CBC";
|
|
87
|
+
readonly '2.16.840.1.101.3.4.1.22': "aes192-CBC";
|
|
88
|
+
readonly '2.16.840.1.101.3.4.1.42': "aes256-CBC";
|
|
89
|
+
readonly '2.5.4.3': "commonName";
|
|
90
|
+
readonly '2.5.4.4': "surname";
|
|
91
|
+
readonly '2.5.4.5': "serialNumber";
|
|
92
|
+
readonly '2.5.4.6': "countryName";
|
|
93
|
+
readonly '2.5.4.7': "localityName";
|
|
94
|
+
readonly '2.5.4.8': "stateOrProvinceName";
|
|
95
|
+
readonly '2.5.4.9': "streetAddress";
|
|
96
|
+
readonly '2.5.4.10': "organizationName";
|
|
97
|
+
readonly '2.5.4.11': "organizationalUnitName";
|
|
98
|
+
readonly '2.5.4.12': "title";
|
|
99
|
+
readonly '2.5.4.13': "description";
|
|
100
|
+
readonly '2.5.4.15': "businessCategory";
|
|
101
|
+
readonly '2.5.4.17': "postalCode";
|
|
102
|
+
readonly '2.5.4.42': "givenName";
|
|
103
|
+
readonly '1.3.6.1.4.1.311.60.2.1.2': "jurisdictionOfIncorporationStateOrProvinceName";
|
|
104
|
+
readonly '1.3.6.1.4.1.311.60.2.1.3': "jurisdictionOfIncorporationCountryName";
|
|
105
|
+
readonly '2.16.840.1.113730.1.1': "nsCertType";
|
|
106
|
+
readonly '2.16.840.1.113730.1.13': "nsComment";
|
|
107
|
+
readonly '2.5.29.14': "subjectKeyIdentifier";
|
|
108
|
+
readonly '2.5.29.15': "keyUsage";
|
|
109
|
+
readonly '2.5.29.17': "subjectAltName";
|
|
110
|
+
readonly '2.5.29.18': "issuerAltName";
|
|
111
|
+
readonly '2.5.29.19': "basicConstraints";
|
|
112
|
+
readonly '2.5.29.31': "cRLDistributionPoints";
|
|
113
|
+
readonly '2.5.29.32': "certificatePolicies";
|
|
114
|
+
readonly '2.5.29.35': "authorityKeyIdentifier";
|
|
115
|
+
readonly '2.5.29.37': "extKeyUsage";
|
|
116
|
+
readonly '1.3.6.1.4.1.11129.2.4.2': "timestampList";
|
|
117
|
+
readonly '1.3.6.1.5.5.7.1.1': "authorityInfoAccess";
|
|
118
|
+
readonly '1.3.6.1.5.5.7.3.1': "serverAuth";
|
|
119
|
+
readonly '1.3.6.1.5.5.7.3.2': "clientAuth";
|
|
120
|
+
readonly '1.3.6.1.5.5.7.3.3': "codeSigning";
|
|
121
|
+
readonly '1.3.6.1.5.5.7.3.4': "emailProtection";
|
|
122
|
+
readonly '1.3.6.1.5.5.7.3.8': "timeStamping";
|
|
123
|
+
};
|
|
124
|
+
export interface DistinguishedName {
|
|
125
|
+
countryName?: string;
|
|
126
|
+
organizationName?: string;
|
|
127
|
+
commonName?: string;
|
|
128
|
+
localityName?: string;
|
|
129
|
+
stateOrProvinceName?: string;
|
|
130
|
+
streetAddress?: string;
|
|
131
|
+
postalCode?: string;
|
|
132
|
+
emailAddress?: string;
|
|
133
|
+
organizationalUnitName?: string;
|
|
134
|
+
title?: string;
|
|
135
|
+
description?: string;
|
|
136
|
+
businessCategory?: string;
|
|
137
|
+
}
|
|
138
|
+
export type Validity = {
|
|
139
|
+
notBefore: Date;
|
|
140
|
+
notAfter: Date;
|
|
141
|
+
};
|
|
142
|
+
export type OID = keyof typeof oids;
|
|
143
|
+
export type OIDName = (typeof oids)[OID];
|
|
144
|
+
export interface BasicConstraints {
|
|
145
|
+
ca: boolean;
|
|
146
|
+
pathLenConstraint?: number;
|
|
147
|
+
}
|
|
148
|
+
export interface KeyUsage {
|
|
149
|
+
digitalSignature?: boolean;
|
|
150
|
+
nonRepudiation?: boolean;
|
|
151
|
+
keyEncipherment?: boolean;
|
|
152
|
+
dataEncipherment?: boolean;
|
|
153
|
+
keyAgreement?: boolean;
|
|
154
|
+
keyCertSign?: boolean;
|
|
155
|
+
cRLSign?: boolean;
|
|
156
|
+
encipherOnly?: boolean;
|
|
157
|
+
decipherOnly?: boolean;
|
|
158
|
+
}
|
|
159
|
+
export interface ExtKeyUsage {
|
|
160
|
+
serverAuth?: boolean;
|
|
161
|
+
clientAuth?: boolean;
|
|
162
|
+
codeSigning?: boolean;
|
|
163
|
+
emailProtection?: boolean;
|
|
164
|
+
timeStamping?: boolean;
|
|
165
|
+
}
|
|
166
|
+
export interface NSCertType {
|
|
167
|
+
client?: boolean;
|
|
168
|
+
server?: boolean;
|
|
169
|
+
email?: boolean;
|
|
170
|
+
objsign?: boolean;
|
|
171
|
+
sslCA?: boolean;
|
|
172
|
+
emailCA?: boolean;
|
|
173
|
+
objCA?: boolean;
|
|
174
|
+
}
|
|
175
|
+
export interface SubjectAltNames {
|
|
176
|
+
dnsNames?: string[];
|
|
177
|
+
ipAddresses?: string[];
|
|
178
|
+
}
|
|
179
|
+
export interface TBSCertificateDescription {
|
|
180
|
+
version?: number;
|
|
181
|
+
serialNumber?: Uint8Array;
|
|
182
|
+
signatureAlgorithm?: OIDName;
|
|
183
|
+
issuer?: DistinguishedName;
|
|
184
|
+
validity?: Validity;
|
|
185
|
+
subject: DistinguishedName;
|
|
186
|
+
basicConstraints?: BasicConstraints;
|
|
187
|
+
keyUsage?: KeyUsage;
|
|
188
|
+
extKeyUsage?: ExtKeyUsage;
|
|
189
|
+
subjectAltNames?: SubjectAltNames;
|
|
190
|
+
nsCertType?: NSCertType;
|
|
191
|
+
}
|
|
192
|
+
export type TBSCertificate = Uint8Array;
|
|
193
|
+
export type GeneratedCertificate = {
|
|
194
|
+
keyPair: CryptoKeyPair;
|
|
195
|
+
certificate: Uint8Array;
|
|
196
|
+
tbsDescription: TBSCertificateDescription;
|
|
197
|
+
tbsCertificate: TBSCertificate;
|
|
198
|
+
};
|
|
199
|
+
export {};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TLS1 cipher suites sourced from OpenSSL:
|
|
3
|
+
*
|
|
4
|
+
* https://github.com/openssl/openssl/blob/36254fda37fe169e136079404a3c32aeea35cbd4/include/openssl/tls1.h#L371
|
|
5
|
+
*/
|
|
6
|
+
export declare const CipherSuites: {
|
|
7
|
+
readonly TLS1_CK_PSK_WITH_RC4_128_SHA: 138;
|
|
8
|
+
readonly TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA: 139;
|
|
9
|
+
readonly TLS1_CK_PSK_WITH_AES_128_CBC_SHA: 140;
|
|
10
|
+
readonly TLS1_CK_PSK_WITH_AES_256_CBC_SHA: 141;
|
|
11
|
+
readonly TLS1_CK_DHE_PSK_WITH_RC4_128_SHA: 142;
|
|
12
|
+
readonly TLS1_CK_DHE_PSK_WITH_3DES_EDE_CBC_SHA: 143;
|
|
13
|
+
readonly TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA: 144;
|
|
14
|
+
readonly TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA: 145;
|
|
15
|
+
readonly TLS1_CK_RSA_PSK_WITH_RC4_128_SHA: 146;
|
|
16
|
+
readonly TLS1_CK_RSA_PSK_WITH_3DES_EDE_CBC_SHA: 147;
|
|
17
|
+
readonly TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA: 148;
|
|
18
|
+
readonly TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA: 149;
|
|
19
|
+
readonly TLS1_CK_PSK_WITH_AES_128_GCM_SHA256: 168;
|
|
20
|
+
readonly TLS1_CK_PSK_WITH_AES_256_GCM_SHA384: 169;
|
|
21
|
+
readonly TLS1_CK_DHE_PSK_WITH_AES_128_GCM_SHA256: 170;
|
|
22
|
+
readonly TLS1_CK_DHE_PSK_WITH_AES_256_GCM_SHA384: 171;
|
|
23
|
+
readonly TLS1_CK_RSA_PSK_WITH_AES_128_GCM_SHA256: 172;
|
|
24
|
+
readonly TLS1_CK_RSA_PSK_WITH_AES_256_GCM_SHA384: 173;
|
|
25
|
+
readonly TLS1_CK_PSK_WITH_AES_128_CBC_SHA256: 174;
|
|
26
|
+
readonly TLS1_CK_PSK_WITH_AES_256_CBC_SHA384: 175;
|
|
27
|
+
readonly TLS1_CK_PSK_WITH_NULL_SHA256: 176;
|
|
28
|
+
readonly TLS1_CK_PSK_WITH_NULL_SHA384: 177;
|
|
29
|
+
readonly TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA256: 178;
|
|
30
|
+
readonly TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA384: 179;
|
|
31
|
+
readonly TLS1_CK_DHE_PSK_WITH_NULL_SHA256: 180;
|
|
32
|
+
readonly TLS1_CK_DHE_PSK_WITH_NULL_SHA384: 181;
|
|
33
|
+
readonly TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA256: 182;
|
|
34
|
+
readonly TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA384: 183;
|
|
35
|
+
readonly TLS1_CK_RSA_PSK_WITH_NULL_SHA256: 184;
|
|
36
|
+
readonly TLS1_CK_RSA_PSK_WITH_NULL_SHA384: 185;
|
|
37
|
+
readonly TLS1_CK_PSK_WITH_NULL_SHA: 44;
|
|
38
|
+
readonly TLS1_CK_DHE_PSK_WITH_NULL_SHA: 45;
|
|
39
|
+
readonly TLS1_CK_RSA_PSK_WITH_NULL_SHA: 46;
|
|
40
|
+
readonly TLS1_CK_RSA_WITH_AES_128_SHA: 47;
|
|
41
|
+
readonly TLS1_CK_DH_DSS_WITH_AES_128_SHA: 48;
|
|
42
|
+
readonly TLS1_CK_DH_RSA_WITH_AES_128_SHA: 49;
|
|
43
|
+
readonly TLS1_CK_DHE_DSS_WITH_AES_128_SHA: 50;
|
|
44
|
+
readonly TLS1_CK_DHE_RSA_WITH_AES_128_SHA: 51;
|
|
45
|
+
readonly TLS1_CK_ADH_WITH_AES_128_SHA: 52;
|
|
46
|
+
readonly TLS1_CK_RSA_WITH_AES_256_SHA: 53;
|
|
47
|
+
readonly TLS1_CK_DH_DSS_WITH_AES_256_SHA: 54;
|
|
48
|
+
readonly TLS1_CK_DH_RSA_WITH_AES_256_SHA: 55;
|
|
49
|
+
readonly TLS1_CK_DHE_DSS_WITH_AES_256_SHA: 56;
|
|
50
|
+
readonly TLS1_CK_DHE_RSA_WITH_AES_256_SHA: 57;
|
|
51
|
+
readonly TLS1_CK_ADH_WITH_AES_256_SHA: 58;
|
|
52
|
+
readonly TLS1_CK_RSA_WITH_NULL_SHA256: 59;
|
|
53
|
+
readonly TLS1_CK_RSA_WITH_AES_128_SHA256: 60;
|
|
54
|
+
readonly TLS1_CK_RSA_WITH_AES_256_SHA256: 61;
|
|
55
|
+
readonly TLS1_CK_DH_DSS_WITH_AES_128_SHA256: 62;
|
|
56
|
+
readonly TLS1_CK_DH_RSA_WITH_AES_128_SHA256: 63;
|
|
57
|
+
readonly TLS1_CK_DHE_DSS_WITH_AES_128_SHA256: 64;
|
|
58
|
+
readonly TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA: 65;
|
|
59
|
+
readonly TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA: 66;
|
|
60
|
+
readonly TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA: 67;
|
|
61
|
+
readonly TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA: 68;
|
|
62
|
+
readonly TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA: 69;
|
|
63
|
+
readonly TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA: 70;
|
|
64
|
+
readonly TLS1_CK_DHE_RSA_WITH_AES_128_SHA256: 103;
|
|
65
|
+
readonly TLS1_CK_DH_DSS_WITH_AES_256_SHA256: 104;
|
|
66
|
+
readonly TLS1_CK_DH_RSA_WITH_AES_256_SHA256: 105;
|
|
67
|
+
readonly TLS1_CK_DHE_DSS_WITH_AES_256_SHA256: 106;
|
|
68
|
+
readonly TLS1_CK_DHE_RSA_WITH_AES_256_SHA256: 107;
|
|
69
|
+
readonly TLS1_CK_ADH_WITH_AES_128_SHA256: 108;
|
|
70
|
+
readonly TLS1_CK_ADH_WITH_AES_256_SHA256: 109;
|
|
71
|
+
readonly TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA: 132;
|
|
72
|
+
readonly TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA: 133;
|
|
73
|
+
readonly TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA: 134;
|
|
74
|
+
readonly TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA: 135;
|
|
75
|
+
readonly TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA: 136;
|
|
76
|
+
readonly TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA: 137;
|
|
77
|
+
readonly TLS1_CK_RSA_WITH_SEED_SHA: 150;
|
|
78
|
+
readonly TLS1_CK_DH_DSS_WITH_SEED_SHA: 151;
|
|
79
|
+
readonly TLS1_CK_DH_RSA_WITH_SEED_SHA: 152;
|
|
80
|
+
readonly TLS1_CK_DHE_DSS_WITH_SEED_SHA: 153;
|
|
81
|
+
readonly TLS1_CK_DHE_RSA_WITH_SEED_SHA: 154;
|
|
82
|
+
readonly TLS1_CK_ADH_WITH_SEED_SHA: 155;
|
|
83
|
+
readonly TLS1_CK_RSA_WITH_AES_128_GCM_SHA256: 156;
|
|
84
|
+
readonly TLS1_CK_RSA_WITH_AES_256_GCM_SHA384: 157;
|
|
85
|
+
readonly TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256: 158;
|
|
86
|
+
readonly TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384: 159;
|
|
87
|
+
readonly TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256: 160;
|
|
88
|
+
readonly TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384: 161;
|
|
89
|
+
readonly TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256: 162;
|
|
90
|
+
readonly TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384: 163;
|
|
91
|
+
readonly TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256: 164;
|
|
92
|
+
readonly TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384: 165;
|
|
93
|
+
readonly TLS1_CK_ADH_WITH_AES_128_GCM_SHA256: 166;
|
|
94
|
+
readonly TLS1_CK_ADH_WITH_AES_256_GCM_SHA384: 167;
|
|
95
|
+
readonly TLS1_CK_RSA_WITH_AES_128_CCM: 49308;
|
|
96
|
+
readonly TLS1_CK_RSA_WITH_AES_256_CCM: 49309;
|
|
97
|
+
readonly TLS1_CK_DHE_RSA_WITH_AES_128_CCM: 49310;
|
|
98
|
+
readonly TLS1_CK_DHE_RSA_WITH_AES_256_CCM: 49311;
|
|
99
|
+
readonly TLS1_CK_RSA_WITH_AES_128_CCM_8: 49312;
|
|
100
|
+
readonly TLS1_CK_RSA_WITH_AES_256_CCM_8: 49313;
|
|
101
|
+
readonly TLS1_CK_DHE_RSA_WITH_AES_128_CCM_8: 49314;
|
|
102
|
+
readonly TLS1_CK_DHE_RSA_WITH_AES_256_CCM_8: 49315;
|
|
103
|
+
readonly TLS1_CK_PSK_WITH_AES_128_CCM: 49316;
|
|
104
|
+
readonly TLS1_CK_PSK_WITH_AES_256_CCM: 49317;
|
|
105
|
+
readonly TLS1_CK_DHE_PSK_WITH_AES_128_CCM: 49318;
|
|
106
|
+
readonly TLS1_CK_DHE_PSK_WITH_AES_256_CCM: 49319;
|
|
107
|
+
readonly TLS1_CK_PSK_WITH_AES_128_CCM_8: 49320;
|
|
108
|
+
readonly TLS1_CK_PSK_WITH_AES_256_CCM_8: 49321;
|
|
109
|
+
readonly TLS1_CK_DHE_PSK_WITH_AES_128_CCM_8: 49322;
|
|
110
|
+
readonly TLS1_CK_DHE_PSK_WITH_AES_256_CCM_8: 49323;
|
|
111
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM: 49324;
|
|
112
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM: 49325;
|
|
113
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM_8: 49326;
|
|
114
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM_8: 49327;
|
|
115
|
+
readonly TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA256: 186;
|
|
116
|
+
readonly TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256: 187;
|
|
117
|
+
readonly TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256: 188;
|
|
118
|
+
readonly TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256: 189;
|
|
119
|
+
readonly TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: 190;
|
|
120
|
+
readonly TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA256: 191;
|
|
121
|
+
readonly TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA256: 192;
|
|
122
|
+
readonly TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256: 193;
|
|
123
|
+
readonly TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256: 194;
|
|
124
|
+
readonly TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256: 195;
|
|
125
|
+
readonly TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256: 196;
|
|
126
|
+
readonly TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA256: 197;
|
|
127
|
+
readonly TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA: 49153;
|
|
128
|
+
readonly TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA: 49154;
|
|
129
|
+
readonly TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA: 49155;
|
|
130
|
+
readonly TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA: 49156;
|
|
131
|
+
readonly TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA: 49157;
|
|
132
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA: 49158;
|
|
133
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA: 49159;
|
|
134
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA: 49160;
|
|
135
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: 49161;
|
|
136
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: 49162;
|
|
137
|
+
readonly TLS1_CK_ECDH_RSA_WITH_NULL_SHA: 49163;
|
|
138
|
+
readonly TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA: 49164;
|
|
139
|
+
readonly TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA: 49165;
|
|
140
|
+
readonly TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA: 49166;
|
|
141
|
+
readonly TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA: 49167;
|
|
142
|
+
readonly TLS1_CK_ECDHE_RSA_WITH_NULL_SHA: 49168;
|
|
143
|
+
readonly TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA: 49169;
|
|
144
|
+
readonly TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA: 49170;
|
|
145
|
+
readonly TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA: 49171;
|
|
146
|
+
readonly TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA: 49172;
|
|
147
|
+
readonly TLS1_CK_ECDH_anon_WITH_NULL_SHA: 49173;
|
|
148
|
+
readonly TLS1_CK_ECDH_anon_WITH_RC4_128_SHA: 49174;
|
|
149
|
+
readonly TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA: 49175;
|
|
150
|
+
readonly TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA: 49176;
|
|
151
|
+
readonly TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA: 49177;
|
|
152
|
+
readonly TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA: 49178;
|
|
153
|
+
readonly TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA: 49179;
|
|
154
|
+
readonly TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA: 49180;
|
|
155
|
+
readonly TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA: 49181;
|
|
156
|
+
readonly TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA: 49182;
|
|
157
|
+
readonly TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA: 49183;
|
|
158
|
+
readonly TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA: 49184;
|
|
159
|
+
readonly TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA: 49185;
|
|
160
|
+
readonly TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA: 49186;
|
|
161
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256: 49187;
|
|
162
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384: 49188;
|
|
163
|
+
readonly TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256: 49189;
|
|
164
|
+
readonly TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384: 49190;
|
|
165
|
+
readonly TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256: 49191;
|
|
166
|
+
readonly TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384: 49192;
|
|
167
|
+
readonly TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256: 49193;
|
|
168
|
+
readonly TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384: 49194;
|
|
169
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: 49195;
|
|
170
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: 49196;
|
|
171
|
+
readonly TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256: 49197;
|
|
172
|
+
readonly TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384: 49198;
|
|
173
|
+
readonly TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256: 49199;
|
|
174
|
+
readonly TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384: 49200;
|
|
175
|
+
readonly TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256: 49201;
|
|
176
|
+
readonly TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384: 49202;
|
|
177
|
+
readonly TLS1_CK_ECDHE_PSK_WITH_RC4_128_SHA: 49203;
|
|
178
|
+
readonly TLS1_CK_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA: 49204;
|
|
179
|
+
readonly TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA: 49205;
|
|
180
|
+
readonly TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA: 49206;
|
|
181
|
+
readonly TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA256: 49207;
|
|
182
|
+
readonly TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA384: 49208;
|
|
183
|
+
readonly TLS1_CK_ECDHE_PSK_WITH_NULL_SHA: 49209;
|
|
184
|
+
readonly TLS1_CK_ECDHE_PSK_WITH_NULL_SHA256: 49210;
|
|
185
|
+
readonly TLS1_CK_ECDHE_PSK_WITH_NULL_SHA384: 49211;
|
|
186
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: 49266;
|
|
187
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: 49267;
|
|
188
|
+
readonly TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: 49268;
|
|
189
|
+
readonly TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: 49269;
|
|
190
|
+
readonly TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: 49270;
|
|
191
|
+
readonly TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384: 49271;
|
|
192
|
+
readonly TLS1_CK_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256: 49272;
|
|
193
|
+
readonly TLS1_CK_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384: 49273;
|
|
194
|
+
readonly TLS1_CK_PSK_WITH_CAMELLIA_128_CBC_SHA256: 49300;
|
|
195
|
+
readonly TLS1_CK_PSK_WITH_CAMELLIA_256_CBC_SHA384: 49301;
|
|
196
|
+
readonly TLS1_CK_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256: 49302;
|
|
197
|
+
readonly TLS1_CK_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: 49303;
|
|
198
|
+
readonly TLS1_CK_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256: 49304;
|
|
199
|
+
readonly TLS1_CK_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384: 49305;
|
|
200
|
+
readonly TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256: 49306;
|
|
201
|
+
readonly TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: 49307;
|
|
202
|
+
readonly TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305: 52392;
|
|
203
|
+
readonly TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305: 52393;
|
|
204
|
+
readonly TLS1_CK_DHE_RSA_WITH_CHACHA20_POLY1305: 52394;
|
|
205
|
+
readonly TLS1_CK_PSK_WITH_CHACHA20_POLY1305: 52395;
|
|
206
|
+
readonly TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305: 52396;
|
|
207
|
+
readonly TLS1_CK_DHE_PSK_WITH_CHACHA20_POLY1305: 52397;
|
|
208
|
+
readonly TLS1_CK_RSA_PSK_WITH_CHACHA20_POLY1305: 52398;
|
|
209
|
+
};
|
|
210
|
+
export declare const CipherSuitesNames: any;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TLS server_name extension
|
|
3
|
+
* https://www.rfc-editor.org/rfc/rfc6066.html
|
|
4
|
+
*/
|
|
5
|
+
export interface ServerNameList {
|
|
6
|
+
server_name_list: ServerName[];
|
|
7
|
+
}
|
|
8
|
+
export interface ServerName {
|
|
9
|
+
name_type: typeof ServerNameTypes;
|
|
10
|
+
name: {
|
|
11
|
+
host_name: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare const ServerNameTypes: {
|
|
15
|
+
readonly host_name: 0;
|
|
16
|
+
};
|
|
17
|
+
export type ServerNameType = (typeof ServerNameTypes)[keyof typeof ServerNameTypes];
|
|
18
|
+
export declare const ServerNameNames: any;
|
|
19
|
+
export declare class ServerNameExtension {
|
|
20
|
+
static decodeFromClient(data: Uint8Array): ServerNameList;
|
|
21
|
+
/**
|
|
22
|
+
* Encode the server_name extension
|
|
23
|
+
*
|
|
24
|
+
* +------------------------------------+
|
|
25
|
+
* | Extension Type (server_name) [2B] |
|
|
26
|
+
* | 0x00 0x00 |
|
|
27
|
+
* +------------------------------------+
|
|
28
|
+
* | Extension Length [2B] |
|
|
29
|
+
* | 0x00 0x00 |
|
|
30
|
+
* +------------------------------------+
|
|
31
|
+
*/
|
|
32
|
+
static encodeForClient(serverNames?: ServerNameList): Uint8Array;
|
|
33
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TLS supported_groups extension
|
|
3
|
+
* https://www.iana.org/go/rfc7919
|
|
4
|
+
* https://www.iana.org/go/rfc8422
|
|
5
|
+
*/
|
|
6
|
+
export declare const SupportedGroups: {
|
|
7
|
+
readonly secp256r1: 23;
|
|
8
|
+
readonly secp384r1: 24;
|
|
9
|
+
readonly secp521r1: 25;
|
|
10
|
+
readonly x25519: 29;
|
|
11
|
+
readonly x448: 30;
|
|
12
|
+
};
|
|
13
|
+
export declare const SupportedGroupsNames: any;
|
|
14
|
+
export type SupportedGroup = keyof typeof SupportedGroups;
|
|
15
|
+
export type ParsedSupportedGroups = (keyof typeof SupportedGroups)[];
|
|
16
|
+
export declare class SupportedGroupsExtension {
|
|
17
|
+
/**
|
|
18
|
+
* +--------------------------------------------------+
|
|
19
|
+
* | Payload Length [2B] |
|
|
20
|
+
* +--------------------------------------------------+
|
|
21
|
+
* | Supported Groups List Length [2B] |
|
|
22
|
+
* +--------------------------------------------------+
|
|
23
|
+
* | Supported Group 1 [2B] |
|
|
24
|
+
* +--------------------------------------------------+
|
|
25
|
+
* | Supported Group 2 [2B] |
|
|
26
|
+
* +--------------------------------------------------+
|
|
27
|
+
* | ... |
|
|
28
|
+
* +--------------------------------------------------+
|
|
29
|
+
* | Supported Group n [2B] |
|
|
30
|
+
* +--------------------------------------------------+
|
|
31
|
+
*/
|
|
32
|
+
static decodeFromClient(data: Uint8Array): ParsedSupportedGroups;
|
|
33
|
+
/**
|
|
34
|
+
* +--------------------------------------------------+
|
|
35
|
+
* | Extension Type (supported_groups) [2B] |
|
|
36
|
+
* | 0x00 0x0A |
|
|
37
|
+
* +--------------------------------------------------+
|
|
38
|
+
* | Extension Length [2B] |
|
|
39
|
+
* +--------------------------------------------------+
|
|
40
|
+
* | Selected Group [2B] |
|
|
41
|
+
* +--------------------------------------------------+
|
|
42
|
+
*/
|
|
43
|
+
static encodeForClient(group: SupportedGroup): Uint8Array;
|
|
44
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TLS ec_point_formats extension
|
|
3
|
+
* https://www.rfc-editor.org/rfc/rfc4492#section-5.1.2
|
|
4
|
+
*/
|
|
5
|
+
export declare const ECPointFormats: {
|
|
6
|
+
readonly uncompressed: 0;
|
|
7
|
+
readonly ansiX962_compressed_prime: 1;
|
|
8
|
+
readonly ansiX962_compressed_char2: 2;
|
|
9
|
+
};
|
|
10
|
+
export type ECPointFormat = keyof typeof ECPointFormats;
|
|
11
|
+
export declare const ECPointFormatNames: any;
|
|
12
|
+
export type ParsedECPointFormats = (keyof typeof ECPointFormats)[];
|
|
13
|
+
export declare class ECPointFormatsExtension {
|
|
14
|
+
/**
|
|
15
|
+
* +--------------------------------------------------+
|
|
16
|
+
* | Payload Length [2B] |
|
|
17
|
+
* +--------------------------------------------------+
|
|
18
|
+
* | EC Point Formats Length [1B] |
|
|
19
|
+
* +--------------------------------------------------+
|
|
20
|
+
* | EC Point Format 1 [1B] |
|
|
21
|
+
* +--------------------------------------------------+
|
|
22
|
+
* | EC Point Format 2 [1B] |
|
|
23
|
+
* +--------------------------------------------------+
|
|
24
|
+
* | ... |
|
|
25
|
+
* +--------------------------------------------------+
|
|
26
|
+
* | EC Point Format n [1B] |
|
|
27
|
+
* +--------------------------------------------------+
|
|
28
|
+
*/
|
|
29
|
+
static decodeFromClient(data: Uint8Array): ParsedECPointFormats;
|
|
30
|
+
/**
|
|
31
|
+
* Encode the ec_point_formats extension
|
|
32
|
+
*
|
|
33
|
+
* +--------------------------------------------------+
|
|
34
|
+
* | Extension Type (ec_point_formats) [2B] |
|
|
35
|
+
* | 0x00 0x0B |
|
|
36
|
+
* +--------------------------------------------------+
|
|
37
|
+
* | Body Length [2B] |
|
|
38
|
+
* +--------------------------------------------------+
|
|
39
|
+
* | EC Point Format Length [1B] |
|
|
40
|
+
* +--------------------------------------------------+
|
|
41
|
+
* | EC Point Format [1B] |
|
|
42
|
+
* +--------------------------------------------------+
|
|
43
|
+
*/
|
|
44
|
+
static encodeForClient(format: ECPointFormat): Uint8Array;
|
|
45
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TLS signature_algorithms extension
|
|
3
|
+
* https://www.rfc-editor.org/rfc/rfc8446.html#page-41
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* A list of supported signature algorithms,
|
|
7
|
+
* one byte per algorithm.
|
|
8
|
+
*/
|
|
9
|
+
export type SignatureAlgorithms = Uint8Array;
|
|
10
|
+
/**
|
|
11
|
+
* Signature algorithms from
|
|
12
|
+
* https://datatracker.ietf.org/doc/html/rfc5246#section-7.4.1.4.1
|
|
13
|
+
*/
|
|
14
|
+
export declare const SignatureAlgorithms: {
|
|
15
|
+
anonymous: number;
|
|
16
|
+
rsa: number;
|
|
17
|
+
dsa: number;
|
|
18
|
+
ecdsa: number;
|
|
19
|
+
};
|
|
20
|
+
export type SignatureAlgorithm = keyof typeof SignatureAlgorithms;
|
|
21
|
+
export declare const SignatureAlgorithmsNames: any;
|
|
22
|
+
/**
|
|
23
|
+
* Hash algorithms from
|
|
24
|
+
* https://datatracker.ietf.org/doc/html/rfc5246#section-7.4.1.4.1
|
|
25
|
+
*/
|
|
26
|
+
export declare const HashAlgorithms: {
|
|
27
|
+
none: number;
|
|
28
|
+
md5: number;
|
|
29
|
+
sha1: number;
|
|
30
|
+
sha224: number;
|
|
31
|
+
sha256: number;
|
|
32
|
+
sha384: number;
|
|
33
|
+
sha512: number;
|
|
34
|
+
};
|
|
35
|
+
export type HashAlgorithm = keyof typeof HashAlgorithms;
|
|
36
|
+
export declare const HashAlgorithmsNames: any;
|
|
37
|
+
export type ParsedSignatureAlgorithm = {
|
|
38
|
+
hash: HashAlgorithm;
|
|
39
|
+
algorithm: SignatureAlgorithm;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Handles the signature algorithms extension as defined in
|
|
43
|
+
* https://www.rfc-editor.org/rfc/rfc8446.html#page-41
|
|
44
|
+
*/
|
|
45
|
+
export declare class SignatureAlgorithmsExtension {
|
|
46
|
+
/**
|
|
47
|
+
* Binary layout:
|
|
48
|
+
*
|
|
49
|
+
* +------------------------------------+
|
|
50
|
+
* | Payload Length [2B] |
|
|
51
|
+
* +------------------------------------+
|
|
52
|
+
* | Hash Algorithm 1 [1B] |
|
|
53
|
+
* | Signature Algorithm 1 [1B] |
|
|
54
|
+
* +------------------------------------+
|
|
55
|
+
* | Hash Algorithm 2 [1B] |
|
|
56
|
+
* | Signature Algorithm 2 [1B] |
|
|
57
|
+
* +------------------------------------+
|
|
58
|
+
* | ... |
|
|
59
|
+
* +------------------------------------+
|
|
60
|
+
*/
|
|
61
|
+
static decodeFromClient(data: Uint8Array): ParsedSignatureAlgorithm[];
|
|
62
|
+
/**
|
|
63
|
+
* +--------------------------------------------------+
|
|
64
|
+
* | Extension Type (signature_algorithms) [2B] |
|
|
65
|
+
* | 0x00 0x0D |
|
|
66
|
+
* +--------------------------------------------------+
|
|
67
|
+
* | Body Length [2B] |
|
|
68
|
+
* +--------------------------------------------------+
|
|
69
|
+
* | Hash Algorithm [1B] |
|
|
70
|
+
* | Signature Algorithm [1B] |
|
|
71
|
+
* +--------------------------------------------------+
|
|
72
|
+
*/
|
|
73
|
+
static encodeforClient(hash: HashAlgorithm, algorithm: SignatureAlgorithm): Uint8Array;
|
|
74
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ServerNameExtension, ServerNameList } from './0_server_name';
|
|
2
|
+
import { ParsedSupportedGroups, SupportedGroupsExtension } from './10_supported_groups';
|
|
3
|
+
import { ParsedECPointFormats, ECPointFormatsExtension } from './11_ec_point_formats';
|
|
4
|
+
import { SignatureAlgorithms, SignatureAlgorithmsExtension } from './13_signature_algorithms';
|
|
5
|
+
export declare const TLSExtensionsHandlers: {
|
|
6
|
+
readonly server_name: typeof ServerNameExtension;
|
|
7
|
+
readonly signature_algorithms: typeof SignatureAlgorithmsExtension;
|
|
8
|
+
readonly supported_groups: typeof SupportedGroupsExtension;
|
|
9
|
+
readonly ec_point_formats: typeof ECPointFormatsExtension;
|
|
10
|
+
};
|
|
11
|
+
export type SupportedTLSExtension = keyof typeof TLSExtensionsHandlers;
|
|
12
|
+
export type ParsedExtension = {
|
|
13
|
+
type: 'server_name';
|
|
14
|
+
data: ServerNameList;
|
|
15
|
+
raw: Uint8Array;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'signature_algorithms';
|
|
18
|
+
data: SignatureAlgorithms;
|
|
19
|
+
raw: Uint8Array;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'ec_point_formats';
|
|
22
|
+
data: ParsedECPointFormats;
|
|
23
|
+
raw: Uint8Array;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'supported_groups';
|
|
26
|
+
data: ParsedSupportedGroups;
|
|
27
|
+
raw: Uint8Array;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The extensions in a ClientHello message are encoded as follows:
|
|
31
|
+
*
|
|
32
|
+
* struct {
|
|
33
|
+
* ExtensionType extension_type;
|
|
34
|
+
* opaque extension_data<0..2^16-1>;
|
|
35
|
+
* } Extension;
|
|
36
|
+
*
|
|
37
|
+
* The overall extensions structure is:
|
|
38
|
+
*
|
|
39
|
+
* Extension extensions<0..2^16-1>;
|
|
40
|
+
*
|
|
41
|
+
* This means:
|
|
42
|
+
* • There's a 2-byte length field for the entire extensions block.
|
|
43
|
+
* • Followed by zero or more individual extensions.
|
|
44
|
+
*
|
|
45
|
+
* Binary Data Layout
|
|
46
|
+
*
|
|
47
|
+
* +-----------------------------+
|
|
48
|
+
* | Extension 1 Type (2 bytes) |
|
|
49
|
+
* +-----------------------------+
|
|
50
|
+
* | Extension 1 Length (2 bytes)|
|
|
51
|
+
* +-----------------------------+
|
|
52
|
+
* | Extension 1 Data (variable) |
|
|
53
|
+
* +-----------------------------+
|
|
54
|
+
* | Extension 2 Type (2 bytes) |
|
|
55
|
+
* +-----------------------------+
|
|
56
|
+
* | Extension 2 Length (2 bytes)|
|
|
57
|
+
* +-----------------------------+
|
|
58
|
+
* | Extension 2 Data (variable) |
|
|
59
|
+
* +-----------------------------+
|
|
60
|
+
* | ... (more extensions) |
|
|
61
|
+
* +-----------------------------+
|
|
62
|
+
*
|
|
63
|
+
* @param data
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
export declare function parseClientHelloExtensions(data: Uint8Array): ParsedExtension[];
|