]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/govpn/cmd/govpn-client/main.go
Initial encryptionless mode support
[govpn.git] / src / govpn / cmd / govpn-client / main.go
index 09b06ca44c753c894357f5b6ebf27fb27e6e5500..da7ac2bb270f54831a5eb51026e29e3f86d6d71f 100644 (file)
@@ -1,6 +1,6 @@
 /*
 GoVPN -- simple secure free software virtual private network daemon
-Copyright (C) 2014-2015 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2016 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -44,6 +44,7 @@ var (
        mtu         = flag.Int("mtu", 1452, "MTU for outgoing packets")
        timeoutP    = flag.Int("timeout", 60, "Timeout seconds")
        noisy       = flag.Bool("noise", false, "Enable noise appending")
+       encless     = flag.Bool("encless", false, "Encryptionless mode")
        cpr         = flag.Int("cpr", 0, "Enable constant KiB/sec out traffic rate")
        egdPath     = flag.String("egd", "", "Optional path to EGD socket")
 
@@ -73,11 +74,18 @@ func main() {
                log.Fatalln(err)
        }
        priv := verifier.PasswordApply(govpn.StringFromFile(*keyPath))
+       if *encless {
+               if *proto != "tcp" {
+                       log.Fatalln("Currently encryptionless mode works only with TCP")
+               }
+               *noisy = true
+       }
        conf = &govpn.PeerConf{
                Id:       verifier.Id,
                Timeout:  time.Second * time.Duration(timeout),
                Noise:    *noisy,
                CPR:      *cpr,
+               EncLess:  *encless,
                Verifier: verifier,
                DSAPriv:  priv,
        }