From 7db8cac2c8e2013d1ccb667bd1f784de355330db Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Tue, 25 Oct 2022 00:18:25 -0400 Subject: [PATCH] remove salt --- pkg/auth/provider.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pkg/auth/provider.go b/pkg/auth/provider.go index a1f4fe5..f372976 100644 --- a/pkg/auth/provider.go +++ b/pkg/auth/provider.go @@ -1,9 +1,7 @@ package auth import ( - "crypto/rand" "encoding/base64" - "encoding/hex" "golang.org/x/crypto/bcrypt" @@ -21,8 +19,6 @@ type User struct { type HomeAssistantProvider struct { AuthProviderBase `json:"-"` Users []User `json:"users"` - - salt string `json:"-"` } func NewHAProvider(s storage.Store) (*HomeAssistantProvider, error) { @@ -41,13 +37,6 @@ func NewHAProvider(s storage.Store) (*HomeAssistantProvider, error) { return hap, nil } -func genSalt() string { - b := make([]byte, 32) - rand.Read(b) - - return hex.EncodeToString(b) -} - func (hap *HomeAssistantProvider) hashPass(p string) ([]byte, error) { return bcrypt.GenerateFromPassword([]byte(p), bcrypt.DefaultCost) }