remove salt

This commit is contained in:
Daniel 2022-10-25 00:18:25 -04:00
parent cb4ccc37b2
commit 7db8cac2c8

View file

@ -1,9 +1,7 @@
package auth package auth
import ( import (
"crypto/rand"
"encoding/base64" "encoding/base64"
"encoding/hex"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
@ -21,8 +19,6 @@ type User struct {
type HomeAssistantProvider struct { type HomeAssistantProvider struct {
AuthProviderBase `json:"-"` AuthProviderBase `json:"-"`
Users []User `json:"users"` Users []User `json:"users"`
salt string `json:"-"`
} }
func NewHAProvider(s storage.Store) (*HomeAssistantProvider, error) { func NewHAProvider(s storage.Store) (*HomeAssistantProvider, error) {
@ -41,13 +37,6 @@ func NewHAProvider(s storage.Store) (*HomeAssistantProvider, error) {
return hap, nil 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) { func (hap *HomeAssistantProvider) hashPass(p string) ([]byte, error) {
return bcrypt.GenerateFromPassword([]byte(p), bcrypt.DefaultCost) return bcrypt.GenerateFromPassword([]byte(p), bcrypt.DefaultCost)
} }