MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / unpacketize

Function unpacketize

modules/crypt/ssl/ssl_changecipher.js:48–57  ·  view source on GitHub ↗
(session, fragment)

Source from the content-addressed store, hash-verified

46const changeCipherSpec = Object.freeze({
47 name: "changeCipherSpec",
48 unpacketize(session, fragment) {
49 session.traceProtocol(this);
50 var type = (new SSLStream(fragment)).readChar();
51 if (type == change_cipher_spec) {
52 session.readSeqNum = BigInt(0); // the specification is very ambiguous about the sequence number...
53 return SetupCipher(session, !session.connectionEnd); // tail call optimization
54 }
55 else
56 throw new TLSError("changeCipherSpec: bad type");
57 },
58 packetize(session, type) {
59 session.traceProtocol(this);
60 var s = new SSLStream();

Callers

nothing calls this directly

Calls 3

SetupCipherFunction · 0.85
readCharMethod · 0.80
traceProtocolMethod · 0.45

Tested by

no test coverage detected