From 17277cc6a5d8c4ca4eacaf518a1699a74c44d3cb Mon Sep 17 00:00:00 2001 From: e1732a364fed <75717694+e1732a364fed@users.noreply.github.com> Date: Fri, 13 May 2022 00:09:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E8=AE=A2trojan.User=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proxy/trojan/trojan.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proxy/trojan/trojan.go b/proxy/trojan/trojan.go index 0a955ca..f87015a 100644 --- a/proxy/trojan/trojan.go +++ b/proxy/trojan/trojan.go @@ -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) {