修订trojan.User 代码

This commit is contained in:
e1732a364fed
2022-05-13 00:09:56 +08:00
parent 15c35839c4
commit 17277cc6a5

View File

@@ -63,12 +63,15 @@ func PassBytesToStr(bs []byte) string {
type User struct {
hexStr string
hexBs []byte
plainStr string
}
func NewUserByPlainTextPassword(plainPass string) User {
bs := SHA224(plainPass)
return User{
hexStr: SHA224_hexString(plainPass),
hexBs: bs[:],
plainStr: plainPass,
}
}
@@ -90,7 +93,7 @@ func (u User) AuthStr() string {
//28字节纯二进制
func (u User) AuthBytes() []byte {
return PassStrToBytes(u.hexStr)
return u.hexBs
}
func InitUsers(uc []utils.UserConf) (us []utils.User) {