diff options
Diffstat (limited to 'internal/signer/linux/signer.go')
-rw-r--r-- | internal/signer/linux/signer.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/signer/linux/signer.go b/internal/signer/linux/signer.go index fe75cd9..d032523 100644 --- a/internal/signer/linux/signer.go +++ b/internal/signer/linux/signer.go @@ -15,6 +15,7 @@ import ( "crypto/x509" "encoding/gob" "io" + "io/ioutil" "log" "net/rpc" "os" @@ -22,6 +23,17 @@ import ( "time" ) +// If ECP Logging is enabled return true +// Otherwise return false +func enableECPLogging() bool { + if os.Getenv("ENABLE_ENTERPRISE_CERTIFICATE_LOGS") != "" { + return true + } + + log.SetOutput(ioutil.Discard) + return false +} + func init() { gob.Register(crypto.SHA256) gob.Register(crypto.SHA384) @@ -76,6 +88,7 @@ func (k *EnterpriseCertSigner) Sign(args SignArgs, resp *[]byte) (err error) { } func main() { + enableECPLogging() if len(os.Args) != 2 { log.Fatalln("Signer is not meant to be invoked manually, exiting...") } |