Browse Source

Allow empty passphrase when using environment variable

tags/fbb2381b
William Petit 4 months ago
parent
commit
ee4c2ad221
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      cmd/keygen/util.go

+ 2
- 2
cmd/keygen/util.go View File

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

Loading…
Cancel
Save