Browse Source

fixed hard coded dns key

0xdcarns 2 years ago
parent
commit
1621c27c1d
2 changed files with 2 additions and 2 deletions
  1. 1 1
      logic/security.go
  2. 1 1
      servercfg/serverconf.go

+ 1 - 1
logic/security.go

@@ -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 {

+ 1 - 1
servercfg/serverconf.go

@@ -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 != "" {