remove salt
This commit is contained in:
parent
cb4ccc37b2
commit
7db8cac2c8
1 changed files with 0 additions and 11 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue