The OpenVPN
network protocol contains the following statement:
Note that when –tls-auth is used, all message types are protected with an HMAC signature, even the initial packets of the TLS handshake. This makes it easy for OpenVPN to throw away bogus packets quickly, without wasting resources on attempting a TLS handshake which will ultimately fail.
I'm stuck while trying to find out how to create this hmac. What to hash and which key to use.
The
docs contain this
function
The security overview contains,
do hmac
I'm using one of these config files http://www.vpngate.net/en/ and I want to test if they are online.
From what I get, the package should look like this:
- packet opcode and key_id (8 bits) > P_CONTROL_HARD_RESET_CLIENT_V2 + 0
- local session_id (64 bit) > random
- HMAC signature???
- packet-id for replay (4 byte) > 0
- acknowledgment packet-id array length (1 byte) > 0
- [acknowledgment packet-id array (if length > 0)] > skip
- [acknowledgment remote session-id (if length > 0)] > skip
- packet-id of this message (4 bytes) > 0
- [TLS payload ciphertext] > skip
Does anybody see anything I'm missing?