[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taldir] branch master updated: Preferably get salt from ENV
From: |
gnunet |
Subject: |
[taler-taldir] branch master updated: Preferably get salt from ENV |
Date: |
Tue, 19 Apr 2022 17:58:04 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository taldir.
The following commit(s) were added to refs/heads/master by this push:
new 2a93458 Preferably get salt from ENV
2a93458 is described below
commit 2a9345852c39be86dab6c221dd7d95363ab8dc96
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Tue Apr 19 17:58:01 2022 +0200
Preferably get salt from ENV
---
taldir.go | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/taldir.go b/taldir.go
index 2c3e914..f85a24f 100644
--- a/taldir.go
+++ b/taldir.go
@@ -104,11 +104,14 @@ func returnSingleEntry(w http.ResponseWriter, r
*http.Request){
// Hashes an identity key (e.g. sha256(<email address>)) with a salt for
// Lookup and storage.
func hashIdentityKey(idkey string) string {
- fmt.Println("Using salt " +
cfg.Section("taldir").Key("salt").MustString("ChangeMe"))
- salt := make([]byte,
len(cfg.Section("taldir").Key("salt").MustString("ChangeMe")))
+ salt := os.Getenv("TALDIR_SALT")
+ if "" == salt {
+ salt = cfg.Section("taldir").Key("salt").MustString("ChangeMe")
+ }
+ fmt.Println("Using salt " + salt)
h := sha256.New()
h.Write([]byte(idkey))
- h.Write(salt)
+ h.Write([]byte(salt))
return base32.StdEncoding.EncodeToString(h.Sum(nil))
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-taldir] branch master updated: Preferably get salt from ENV,
gnunet <=