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

View File

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