Skip to content

Commit

Permalink
fixed hard coded dns key
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdcarns committed Apr 3, 2023
1 parent 49c0224 commit 1621c27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion logic/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func authenticateDNSToken(tokenString string) bool {
if len(tokens) < 2 {
return false
}
return tokens[1] == servercfg.GetDNSKey()
return len(servercfg.GetDNSKey()) > 0 && tokens[1] == servercfg.GetDNSKey()
}

func ContinueIfUserMatch(next http.Handler) http.HandlerFunc {
Expand Down
2 changes: 1 addition & 1 deletion servercfg/serverconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func GetMasterKey() string {

// GetDNSKey - gets the configured dns key of server
func GetDNSKey() string {
key := "secretkey"
key := ""
if os.Getenv("DNS_KEY") != "" {
key = os.Getenv("DNS_KEY")
} else if config.Config.Server.DNSKey != "" {
Expand Down

0 comments on commit 1621c27

Please sign in to comment.