Include the frame number in the header.

This ensures the frame number is covered by the MAC, cleanly
separating encryption from authentication (previously we depended on
the encryption layer to garble frames if they were reordered).
This commit is contained in:
akwizgran
2011-12-02 13:37:44 +00:00
parent 14d5e6fe64
commit 51d58fadad
9 changed files with 144 additions and 80 deletions

View File

@@ -7,6 +7,9 @@ public interface TransportConstants {
*/
static final int MAX_FRAME_LENGTH = 65536; // 2^16, 64 KiB
/** The length of the frame header in bytes. */
static final int FRAME_HEADER_LENGTH = 8;
/**
* The length in bytes of the pseudo-random tag that uniquely identifies a
* connection.