WowConnection
struct · net · 304 bytes
- Meaning
- Holds one socket connection: state, handler, receive buffer, send queue and header cipher
- Confidence
- verified, proof one
- Finding
- net/wire#header-cipher
Finding: Header cipher in net: the wire
Once armed, the connection ciphers the first h + 4 bytes of every packet it sends and the
first h + 2 bytes of every packet it receives, h being that packet's size-header length:
the size header and the opcode. Bodies stay in clear. With a 40-byte key K, an index j
and a feedback byte f, one state per direction:
- send:
c = (K[j] ^ p) + f, thenf = c; - receive:
p = K[j] ^ (c − f), thenf = c; - after each byte,
j = (j + 1) mod 40. Arithmetic is modulo 256.
The index and feedback carry over from packet to packet. Arming zeroes both states.
The derivation is in the doc.
Fields 15
| offset | size | type | name | meaning | confidence | finding |
|---|---|---|---|---|---|---|
0x0010 | 4 | uint32_t | m_state | Holds the socket state: 5 connected, 6 closed, 7 closing | verified, proof one | net/wire#sending |
0x001c | 4 | uint8_t * | m_recvBuffer | Holds the receive buffer | verified, proof one | net/wire#receive-loop |
0x0020 | 4 | uint32_t | m_recvFill | Holds the count of bytes in the receive buffer | verified, proof one | net/wire#receive-loop |
0x0024 | 4 | uint32_t | m_recvCapacity | Holds the receive buffer's size, grown by 1024 | verified, proof one | net/wire#receive-loop |
0x0078 | 16 | uint8_t[16] | m_peerAddress | Holds the peer socket address read when the connection comes up | verified, proof one | net/wire#connecting |
0x0088 | 16 | uint8_t[16] | m_localAddress | Holds the local socket address read when the connection comes up | verified, proof one | net/wire#connecting |
0x0120 | 1 | uint8_t | m_cipherArmed | Holds 1 while the header cipher is armed | verified, proof one | net/wire#header-cipher |
0x0121 | 1 | uint8_t | m_sendIndex | Holds the send key index, 0 to 39 | verified, proof one | net/wire#header-cipher |
0x0122 | 1 | uint8_t | m_sendFeedback | Holds the last ciphertext byte sent | verified, proof one | net/wire#header-cipher |
0x0123 | 1 | uint8_t | m_sendSpan | Holds the bytes after the size header that are ciphered on send, 4 | verified, proof one | net/wire#header-cipher |
0x0124 | 1 | uint8_t | m_recvIndex | Holds the receive key index, 0 to 39 | verified, proof one | net/wire#header-cipher |
0x0125 | 1 | uint8_t | m_recvFeedback | Holds the last ciphertext byte received | verified, proof one | net/wire#header-cipher |
0x0126 | 1 | uint8_t | m_recvSpan | Holds the bytes after the size header that are deciphered on receive, 2 | verified, proof one | net/wire#header-cipher |
0x0127 | 1 | uint8_t | m_keyLength | Holds the key length, 40 | verified, proof one | net/wire#header-cipher |
0x0128 | 4 | uint8_t * | m_key | Holds the key, the NetClient's 40 bytes at +0x48 | verified, proof one | net/wire#header-cipher |