Skip to content

Instantly share code, notes, and snippets.

@ratazzi
Created December 8, 2012 09:33
Show Gist options
  • Save ratazzi/4239543 to your computer and use it in GitHub Desktop.
Save ratazzi/4239543 to your computer and use it in GitHub Desktop.
OpenVPN packet header
src/openvpn/ssl.c
2598-
2599- /* get opcode and key ID */
2600- {
2601- uint8_t c = *BPTR (buf);
2602- op = c >> P_OPCODE_SHIFT;
2603: key_id = c & P_KEY_ID_MASK;
2604- }
src/openvpn/ssl.h
49-
50-/* Used in the TLS PRF function */
51-#define KEY_EXPANSION_ID "OpenVPN"
52-
53-/* packet opcode (high 5 bits) and key-id (low 3 bits) are combined in one byte */
54:#define P_KEY_ID_MASK 0x07
55-#define P_OPCODE_SHIFT 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment