openvpn protocol

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
txdv
OpenVpn Newbie
Posts: 1
Joined: Tue Feb 24, 2015 1:14 pm

openvpn protocol

Post by txdv » Tue Feb 24, 2015 1:52 pm

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.

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: openvpn protocol

Post by Traffic » Wed Feb 25, 2015 5:55 pm

txdv wrote:I understand what HMAC is, but I don't understand what algorithm openvpn uses. Is it somehow negotiated or always static?
The Manual wrote:--auth alg
  • Authenticate packets with HMAC using message digest algorithm alg. (The default is SHA1 ).
https://community.openvpn.net/openvpn/w ... nPage#lbAJ
txdv wrote:I was kinda unable to set up an openvn server of my own.
If you have access to a PC then you can setup your own server ..

Post Reply