fix(proxy): update server key encoding in GenerateShadowsocks2022Password
This commit is contained in:
parent
aae4a10947
commit
617768a4a1
@ -1,16 +1,15 @@
|
|||||||
package proxy
|
package proxy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/base64"
|
||||||
"github.com/perfect-panel/server/pkg/uuidx"
|
"github.com/perfect-panel/server/pkg/uuidx"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GenerateShadowsocks2022Password(ss Shadowsocks, password string) (string, string) {
|
func GenerateShadowsocks2022Password(ss Shadowsocks, password string) (string, string) {
|
||||||
// server key
|
|
||||||
serverKey := ss.ServerKey
|
|
||||||
if ss.Method == "2022-blake3-aes-128-gcm" {
|
if ss.Method == "2022-blake3-aes-128-gcm" {
|
||||||
password = uuidx.UUIDToBase64(password, 16)
|
password = uuidx.UUIDToBase64(password, 16)
|
||||||
} else {
|
} else {
|
||||||
password = uuidx.UUIDToBase64(password, 32)
|
password = uuidx.UUIDToBase64(password, 32)
|
||||||
}
|
}
|
||||||
return serverKey, password
|
return base64.StdEncoding.EncodeToString([]byte(ss.ServerKey)), password
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user