mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 09:58:14 -05:00
fix random pw strength
This commit is contained in:
parent
d37f1ecded
commit
45099f6056
@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"net/netip"
|
||||
"net/url"
|
||||
@ -106,7 +105,7 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
|
||||
case "2022-blake3-aes-256-gcm":
|
||||
keyLength = 32
|
||||
default:
|
||||
keyLength = 8
|
||||
keyLength = 16
|
||||
}
|
||||
in.ShadowsocksOptions = option.ShadowsocksInboundOptions{
|
||||
ListenOptions: listen,
|
||||
@ -114,7 +113,7 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
|
||||
}
|
||||
p := make([]byte, keyLength)
|
||||
_, _ = rand.Read(p)
|
||||
randomPasswd := hex.EncodeToString(p)
|
||||
randomPasswd := string(p)
|
||||
if strings.Contains(info.Cipher, "2022") {
|
||||
in.ShadowsocksOptions.Password = info.ServerKey
|
||||
randomPasswd = base64.StdEncoding.EncodeToString([]byte(randomPasswd))
|
||||
|
Loading…
Reference in New Issue
Block a user