]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/cypherpunks.ru/govpn/cmd/govpn-client/main.go
Replace XTEA with BLAKE2b-based MAC
[govpn.git] / src / cypherpunks.ru / govpn / cmd / govpn-client / main.go
index 58d5ce7d8597022df5a0a9e9197cf71f1dce0cdf..3d8cbe65953fd935f480a9aefde3efec28ed61d8 100644 (file)
@@ -49,6 +49,7 @@ var (
        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")
+       syslog      = flag.Bool("syslog", false, "Enable logging to syslog")
        warranty    = flag.Bool("warranty", false, "Print warranty information")
 
        conf        *govpn.PeerConf
@@ -56,7 +57,7 @@ var (
        timeout     int
        firstUpCall bool = true
        knownPeers  govpn.KnownPeers
-       idsCache    *govpn.CipherCache
+       idsCache    *govpn.MACCache
 )
 
 func main() {
@@ -107,7 +108,7 @@ func main() {
                Verifier: verifier,
                DSAPriv:  priv,
        }
-       idsCache = govpn.NewCipherCache()
+       idsCache = govpn.NewMACCache()
        confs := map[govpn.PeerId]*govpn.PeerConf{*verifier.Id: conf}
        idsCache.Update(&confs)
        log.Println(govpn.VersionGet())
@@ -126,6 +127,10 @@ func main() {
                go govpn.StatsProcessor(statsPort, &knownPeers)
        }
 
+       if *syslog {
+               govpn.SyslogEnable()
+       }
+
        termSignal := make(chan os.Signal, 1)
        signal.Notify(termSignal, os.Interrupt, os.Kill)
 
@@ -151,7 +156,7 @@ MainCycle:
                }
                select {
                case <-termSignal:
-                       log.Fatalln("Finishing")
+                       govpn.BothPrintf(`[finish remote="%s"]`, *remoteAddr)
                        termination <- struct{}{}
                        break MainCycle
                case <-timeouted: