transcriptMsg is a helper used to hash messages which are not hashed when they are read from, or written to, the wire. This is typically the case for messages which are either not sent, or need to be hashed out of order from when they are read/written. For most messages, the message is marshalled u
(msg handshakeMessage, h transcriptHash)
| 1937 | // extension ordering and other malleable fields, which may cause differences |
| 1938 | // between what was received and what we marshal. |
| 1939 | func transcriptMsg(msg handshakeMessage, h transcriptHash) error { |
| 1940 | if msgWithOrig, ok := msg.(handshakeMessageWithOriginalBytes); ok { |
| 1941 | if orig := msgWithOrig.originalBytes(); orig != nil { |
| 1942 | h.Write(msgWithOrig.originalBytes()) |
| 1943 | return nil |
| 1944 | } |
| 1945 | } |
| 1946 | |
| 1947 | data, err := msg.marshal() |
| 1948 | if err != nil { |
| 1949 | return err |
| 1950 | } |
| 1951 | h.Write(data) |
| 1952 | return nil |
| 1953 | } |
no test coverage detected
searching dependent graphs…