Allow empty passphrase when using environment variable

This commit is contained in:
wpetit 2019-03-29 15:15:38 +01:00
parent 19732daaf5
commit ee4c2ad221
1 changed files with 2 additions and 2 deletions

View File

@ -18,8 +18,8 @@ import (
) )
func getPassphrase() ([]byte, error) { func getPassphrase() ([]byte, error) {
passphrase := os.Getenv("KEY_PASSPHRASE") passphrase, exists := os.LookupEnv("KEY_PASSPHRASE")
if passphrase != "" { if exists {
return []byte(passphrase), nil return []byte(passphrase), nil
} }
return askPassphrase() return askPassphrase()