tor/src/trunnel/sendme.trunnel
David Goulet 504e05b029 prop289: Use a 20 bytes digest instead of 4
To achieve such, this commit also changes the trunnel declaration to use a
union instead of a seperate object for the v1 data.

A constant is added for the digest length so we can use it within the SENDME
code giving us a single reference.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-04-29 12:17:57 -04:00

19 lines
472 B
Text

/* This file contains the SENDME cell definition. */
/* v1 digest length in bytes. */
const TRUNNEL_SENDME_V1_DIGEST_LEN = 20;
/* SENDME cell declaration. */
struct sendme_cell {
/* Version field. */
u8 version IN [0x00, 0x01];
/* Length of data contained in this cell. */
u16 data_len;
/* The data content depends on the version. */
union data[version] with length data_len {
0x00: ignore;
0x01: u8 v1_digest[TRUNNEL_SENDME_V1_DIGEST_LEN];
};
}