Hey guys, I am trying to write a C# implementation of an openvpn client.
And I am confused about the format of the openvpn packages. Looking at the implementation is really hard, I can't find the exact place where everything is serialized into a flat byte array. So I wanted to ask you guys for some advice.
I am connecting with a secure socket so I already have everything encrypted, but I can't figure out the proper format of the first packet I am supposed to send. It is a P_CONTROL_HARD_RESET_CLIENT_V2 packet.
Looking into http://openvpn.net/index.php/open-sourc ... rview.html and http://wiki.wireshark.org/OpenVPN I figured that the first package I have to send looks like this:
16bit packet length
8 bit opcode = P_CONTROL_HARD_RESET_CLIENT_V2
32 bit session id = random()
20 bit HMAC = ?
32 bit packet-id = 1
32 bit epoch = current unix time of the machine
8bit message packet-id array length = 0
32 bit message packet-id = 0
I understand what HMAC is, but I don't understand what algorithm openvpn uses. Is it somehow negotiated or always static?
I tried to capture with wireshark what openvpn is sending, but everything is encrypted and I was kinda unable to set up an openvn server of my own.
openvpn protocol
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
- Traffic
- OpenVPN Protagonist
- Posts: 4066
- Joined: Sat Aug 09, 2014 11:24 am
Re: openvpn protocol
txdv wrote:I understand what HMAC is, but I don't understand what algorithm openvpn uses. Is it somehow negotiated or always static?
https://community.openvpn.net/openvpn/w ... nPage#lbAJThe Manual wrote:--auth alg
- Authenticate packets with HMAC using message digest algorithm alg. (The default is SHA1 ).
If you have access to a PC then you can setup your own server ..txdv wrote:I was kinda unable to set up an openvn server of my own.