lemon-tls 0.6.0 → 0.7.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.
- package/package.json +2 -7
- package/src/crypto.js +14 -3
- package/src/dtls_session.js +415 -35
- package/src/record.js +138 -22
- package/src/session/message.js +5 -1
- package/src/session/ticket.js +6 -3
- package/src/tls_session.js +188 -32
- package/src/tls_socket.js +0 -1
- package/src/utils.js +7 -1
- package/src/wire.js +72 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lemon-tls",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "TLS 1.3/1.2 DTLS 1.3/1.2 implementation for Node.js - full control over cryptographic keys, record layer, and handshake. Drop-in replacement for node:tls with advanced options impossible in OpenSSL.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"tls-1.3",
|
|
40
40
|
"tls-1.2",
|
|
41
41
|
"ssl",
|
|
42
|
+
"bogo",
|
|
42
43
|
"https",
|
|
43
44
|
"secure",
|
|
44
45
|
"crypto",
|
|
@@ -70,7 +71,6 @@
|
|
|
70
71
|
"ja3",
|
|
71
72
|
"ja3-fingerprint",
|
|
72
73
|
"fingerprint",
|
|
73
|
-
"certificate-pinning",
|
|
74
74
|
"keylog",
|
|
75
75
|
"wireshark",
|
|
76
76
|
"quic",
|
|
@@ -79,13 +79,8 @@
|
|
|
79
79
|
"pure-javascript",
|
|
80
80
|
"zero-dependencies",
|
|
81
81
|
"no-openssl",
|
|
82
|
-
"no-native",
|
|
83
|
-
"nodejs",
|
|
84
|
-
"node",
|
|
85
|
-
"javascript",
|
|
86
82
|
"security",
|
|
87
83
|
"network",
|
|
88
|
-
"protocol",
|
|
89
84
|
"drop-in-replacement"
|
|
90
85
|
],
|
|
91
86
|
"author": "colocohen",
|
package/src/crypto.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import {
|
|
3
2
|
concatUint8Arrays
|
|
4
3
|
} from './utils.js';
|
|
@@ -735,7 +734,19 @@ function tls13_exporter(hashName, exporter_master_secret, label, context_value,
|
|
|
735
734
|
let h_empty = hashFn(new Uint8Array(0));
|
|
736
735
|
let derived = hkdf_expand_label(hashName, exporter_master_secret, label, h_empty, hashLen, labelPrefix);
|
|
737
736
|
let h_ctx = hashFn(context_value || new Uint8Array(0));
|
|
738
|
-
|
|
737
|
+
// BOTH expansions carry the prefix. RFC 8446 §7.5 defines the exporter
|
|
738
|
+
// as two HKDF-Expand-Label steps, and in DTLS 1.3 both use "dtls13"
|
|
739
|
+
// (RFC 9147 §5.9) — this second one was omitting it and falling back
|
|
740
|
+
// to "tls13 ", so the exported key differed from a conforming peer's.
|
|
741
|
+
// For WebRTC that key IS the DTLS-SRTP keying material: the handshake
|
|
742
|
+
// completes, SRTP reports ready, packets flow in both directions, and
|
|
743
|
+
// NOTHING decrypts. Two peers running this library derive the same
|
|
744
|
+
// wrong key and interoperate perfectly with each other, which is why
|
|
745
|
+
// it only appears against Chrome — and appears as "media does not
|
|
746
|
+
// flow" rather than as a crypto error, since a failed unprotect is
|
|
747
|
+
// just a dropped packet.
|
|
748
|
+
return hkdf_expand(hashName, derived,
|
|
749
|
+
build_hkdf_label('exporter', h_ctx, length, labelPrefix), length);
|
|
739
750
|
}
|
|
740
751
|
|
|
741
752
|
/**
|
|
@@ -896,4 +907,4 @@ export {
|
|
|
896
907
|
derive_exporter_master_secret_with_hash,
|
|
897
908
|
tls13_exporter,
|
|
898
909
|
tls12_exporter,
|
|
899
|
-
};
|
|
910
|
+
};
|