Documentation ¶
Overview ¶
Simple secure, DPI/censorship-resistant free software VPN daemon.
Index ¶
- Constants
- Variables
- func AddTimeSync(ts int, data []byte)
- func BothPrintf(f string, v ...interface{})
- func EGDInit(path string)
- func EnclessDecode(authKey *[32]byte, nonce *[16]byte, in []byte) ([]byte, error)
- func EnclessEncode(authKey *[32]byte, nonce *[16]byte, in []byte) ([]byte, error)
- func KeyRead(path string) (string, error)
- func PeerTapProcessor(peer *Peer, tap *TAP, terminator chan struct{})
- func Printf(f string, v ...interface{})
- func ScriptCall(path, ifaceName, remoteAddr string) ([]byte, error)
- func SliceZero(data []byte)
- func StatsProcessor(statsPort net.Listener, peers *sync.Map)
- func SyslogEnable()
- func VersionGet() string
- type EGDRand
- type Handshake
- type MACAndTimeSync
- type MACCache
- type Peer
- type PeerConf
- type PeerID
- type TAP
- type Verifier
Constants ¶
const ( TimeoutDefault = 60 EtherSize = 14 MTUMax = 9000 + EtherSize + 1 MTUDefault = 1500 + EtherSize + 1 ENV_IFACE = "GOVPN_IFACE" ENV_REMOTE = "GOVPN_REMOTE" )
const ( RSize = 8 SSize = 32 )
const ( NonceSize = 8 NonceBucketSize = 256 TagSize = poly1305.TagSize // S20BS is ChaCha20's internal blocksize in bytes S20BS = 64 // Maximal amount of bytes transfered with single key (4 GiB) MaxBytesPerKey uint64 = 1 << 32 // Heartbeat rate, relative to Timeout TimeoutHeartbeat = 4 // Minimal valid packet length MinPktLength = 1 + 16 + 8 // Padding byte PadByte = byte(0x80) )
const ( DefaultS = 1 << 20 / 32 DefaultT = 1 << 4 DefaultP = 2 )
const (
EnclessEnlargeSize = aont.HSize + aont.RSize*cnw.EnlargeFactor
)
const (
IDSize = 128 / 8
)
const (
RWTimeout = 10 * time.Second
)
const (
Warranty = `` /* 565-byte string literal not displayed */
)
Variables ¶
var (
Rand = rand.Reader
)
var (
Version string = "UNKNOWN"
)
Functions ¶
func AddTimeSync ¶
If timeSync > 0, then XOR timestamp with the data.
func BothPrintf ¶
func BothPrintf(f string, v ...interface{})
Call both default log.Printf and syslog-related one.
func EnclessDecode ¶
Decode EnclessEncode-ed data.
func EnclessEncode ¶
Confidentiality preserving (but encryptionless) encoding.
It uses Chaffing-and-Winnowing technology (it is neither encryption nor steganography) over All-Or-Nothing-Transformed data. nonce is 64-bit nonce. Output data will be EnclessEnlargeSize larger. It also consumes 64-bits of entropy.
func PeerTapProcessor ¶
func Printf ¶
func Printf(f string, v ...interface{})
Call either syslog-related logger.Printf if SyslogEnabled, default log.Printf otherwise.
func ScriptCall ¶
Call external program/script. You have to specify path to it and (inteface name as a rule) something that will be the first argument when calling it. Function will return it's output and possible error.
func StatsProcessor ¶
StatsProcessor is assumed to be run in background. It accepts connection on statsPort, reads anything one send to them and show information about known peers in serialized JSON format. peers argument is a reference to the map with references to the peers as values. Map is used here because of ease of adding and removing elements in it.
func VersionGet ¶
func VersionGet() string
Types ¶
type Handshake ¶
type Handshake struct { LastPing time.Time Conf *PeerConf // contains filtered or unexported fields }
func HandshakeStart ¶
Start handshake's procedure from the client. It is the entry point for starting the handshake procedure. First handshake packet will be sent immediately.
func NewHandshake ¶
Create new handshake state.
func (*Handshake) Client ¶
Process handshake message on the client side. This function is intended to be called on client's side. If this is the final handshake message, then new Peer object will be created and used as a transport. If no mutually authenticated Peer is ready, then return nil.
type MACAndTimeSync ¶
type MACAndTimeSync struct {
// contains filtered or unexported fields
}
type MACCache ¶
type MACCache struct {
// contains filtered or unexported fields
}
func NewMACCache ¶
func NewMACCache() *MACCache
type Peer ¶
type Peer struct { // Statistics (they are at the beginning for correct int64 alignment) BytesIn uint64 BytesOut uint64 BytesPayloadIn uint64 BytesPayloadOut uint64 FramesIn uint64 FramesOut uint64 FramesUnauth uint64 FramesDup uint64 HeartbeatRecv uint64 HeartbeatSent uint64 // Basic Addr string ID *PeerID Conn io.Writer `json:"-"` // Traffic behaviour NoiseEnable bool CPR int CPRCycle time.Duration `json:"-"` Encless bool MTU int // Timers Timeout time.Duration `json:"-"` Established time.Time LastPing time.Time // Receiver BusyR sync.Mutex `json:"-"` // TCP-related NonceExpect []byte `json:"-"` // Transmitter BusyT sync.Mutex `json:"-"` // contains filtered or unexported fields }
func (*Peer) EthProcess ¶
Process incoming Ethernet packet. ready channel is TAPListen's synchronization channel used to tell him that he is free to receive new packets. Encrypted and authenticated packets will be sent to remote Peer side immediately.
func (*Peer) PktProcess ¶
type PeerConf ¶
type PeerConf struct { ID *PeerID `yaml:"-"` Name string `yaml:"name"` Iface string `yaml:"iface"` MTU int `yaml:"mtu"` Up string `yaml:"up"` Down string `yaml:"down"` TimeoutInt int `yaml:"timeout"` Timeout time.Duration `yaml:"-"` Noise bool `yaml:"noise"` CPR int `yaml:"cpr"` Encless bool `yaml:"encless"` TimeSync int `yaml:"timesync"` VerifierRaw string `yaml:"verifier"` // This is passphrase verifier Verifier *Verifier `yaml:"-"` // This field exists only on client's side DSAPriv *[ed25519.PrivateKeySize]byte `yaml:"-"` }
type PeerID ¶
func (PeerID) MarshalJSON ¶
type Verifier ¶
func VerifierFromString ¶
Parse either short or long verifier form.
func VerifierNew ¶
Generate new verifier for given peer, with specified password and hashing parameters.
func (*Verifier) LongForm ¶
Long verifier string form -- it is useful for the server. Includes public key.
func (*Verifier) PasswordApply ¶
func (v *Verifier) PasswordApply(password string) *[ed25519.PrivateKeySize]byte
Apply the password: create Ed25519 keypair based on it, save public key in verifier.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
All-Or-Nothing-Transform, based on OAEP.
|
All-Or-Nothing-Transform, based on OAEP. |
cmd
|
|
govpn-client
Simple secure, DPI/censorship-resistant free software VPN daemon client.
|
Simple secure, DPI/censorship-resistant free software VPN daemon client. |
govpn-server
Simple secure, DPI/censorship-resistant free software VPN daemon.
|
Simple secure, DPI/censorship-resistant free software VPN daemon. |
govpn-verifier
Verifier generator and validator for GoVPN VPN daemon.
|
Verifier generator and validator for GoVPN VPN daemon. |
Chaffing-and-Winnowing.
|
Chaffing-and-Winnowing. |
internal
|
|
chacha20
Package ChaCha20 implements the core ChaCha20 function as specified in https://tools.ietf.org/html/rfc7539#section-2.3.
|
Package ChaCha20 implements the core ChaCha20 function as specified in https://tools.ietf.org/html/rfc7539#section-2.3. |
subtle
Package subtle implements functions that are often useful in cryptographic code but require careful thought to use correctly.
|
Package subtle implements functions that are often useful in cryptographic code but require careful thought to use correctly. |