Add build tags for disabling crypto independently of cgo

This commit is contained in:
Tulir Asokan
2020-08-02 13:55:02 +03:00
parent 1b1d5d9a74
commit 05da509c7c
7 changed files with 21 additions and 28 deletions

11
no-crypto.go Normal file
View File

@@ -0,0 +1,11 @@
// +build !cgo nocrypto
package main
func NewCryptoHelper(bridge *Bridge) Crypto {
if !bridge.Config.Bridge.Encryption.Allow {
bridge.Log.Warnln("Bridge built without end-to-bridge encryption, but encryption is enabled in config")
}
bridge.Log.Debugln("Bridge built without end-to-bridge encryption")
return nil
}