Skip to content

Commit a7befed

Browse files
committed
nearlyfreespeech: fix salt
1 parent a423bb7 commit a7befed

File tree

1 file changed

+4
-2
lines changed
  • providers/dns/nearlyfreespeech/internal

1 file changed

+4
-2
lines changed

providers/dns/nearlyfreespeech/internal/client.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,11 @@ func (c Signer) Sign(uri string, body, login, apiKey string) string {
125125
// Workaround for https://golang.org/issue/58605
126126
uri = "/" + strings.TrimLeft(uri, "/")
127127

128-
hashInput := fmt.Sprintf("%s;%s;%s;%s;%s;%02x", login, timestamp, c.saltShaker(), apiKey, uri, bodyHash)
128+
salt := c.saltShaker()
129129

130-
return fmt.Sprintf("%s;%s;%s;%02x", login, timestamp, c.saltShaker(), sha1.Sum([]byte(hashInput)))
130+
hashInput := fmt.Sprintf("%s;%s;%s;%s;%s;%02x", login, timestamp, salt, apiKey, uri, bodyHash)
131+
132+
return fmt.Sprintf("%s;%s;%s;%02x", login, timestamp, salt, sha1.Sum([]byte(hashInput)))
131133
}
132134

133135
func getRandomSalt() []byte {

0 commit comments

Comments
 (0)