remove salt

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

View file

@ -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)
}