mirror of
https://github.com/XrayR-project/XrayR.git
synced 2025-06-09 13:59:55 +00:00
fix: trim length of userKey for ss2022
This commit is contained in:
parent
eea6c0dea6
commit
acd3cce667
@ -81,11 +81,15 @@ func (c *Controller) buildSSUser(userInfo *[]api.UserInfo, method string) (users
|
|||||||
// // shadowsocks2022 Key = openssl rand -base64 32 and multi users needn't cipher method
|
// // shadowsocks2022 Key = openssl rand -base64 32 and multi users needn't cipher method
|
||||||
if C.Contains(shadowaead_2022.List, strings.ToLower(method)) {
|
if C.Contains(shadowaead_2022.List, strings.ToLower(method)) {
|
||||||
e := c.buildUserTag(&user)
|
e := c.buildUserTag(&user)
|
||||||
|
userKey := user.Passwd[:32]
|
||||||
|
if strings.Contains(method, "128") {
|
||||||
|
userKey = userKey[:16]
|
||||||
|
}
|
||||||
users[i] = &protocol.User{
|
users[i] = &protocol.User{
|
||||||
Level: 0,
|
Level: 0,
|
||||||
Email: e,
|
Email: e,
|
||||||
Account: serial.ToTypedMessage(&shadowsocks_2022.User{
|
Account: serial.ToTypedMessage(&shadowsocks_2022.User{
|
||||||
Key: base64.StdEncoding.EncodeToString([]byte(user.Passwd)),
|
Key: base64.StdEncoding.EncodeToString([]byte(userKey)),
|
||||||
Email: e,
|
Email: e,
|
||||||
Level: 0,
|
Level: 0,
|
||||||
}),
|
}),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user