mirror of https://github.com/v2ray/v2ray-core
fix build break
parent
40c3a01e68
commit
3f634eb54f
|
@ -12,14 +12,14 @@ import (
|
|||
|
||||
func (this *Config) UnmarshalJSON(data []byte) error {
|
||||
type JsonConfig struct {
|
||||
Cipher *serial.StringLiteral `json:"method"`
|
||||
Password *serial.StringLiteral `json:"password"`
|
||||
Cipher serial.StringLiteral `json:"method"`
|
||||
Password serial.StringLiteral `json:"password"`
|
||||
}
|
||||
jsonConfig := new(JsonConfig)
|
||||
if err := json.Unmarshal(data, jsonConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
if this.Password == nil {
|
||||
if len(jsonConfig.Password) == 0 {
|
||||
log.Error("Shadowsocks: Password is not specified.")
|
||||
return internal.ErrorBadConfiguration
|
||||
}
|
||||
|
@ -32,11 +32,11 @@ func (this *Config) UnmarshalJSON(data []byte) error {
|
|||
switch jsonConfig.Cipher.String() {
|
||||
case "aes-256-cfb":
|
||||
this.Cipher = &AesCfb{
|
||||
KeyBytes: 32
|
||||
KeyBytes: 32,
|
||||
}
|
||||
case "aes-128-cfb":
|
||||
this.Cipher = &AesCfb{
|
||||
KeyBytes: 32
|
||||
KeyBytes: 32,
|
||||
}
|
||||
default:
|
||||
log.Error("Shadowsocks: Unknown cipher method: ", jsonConfig.Cipher)
|
||||
|
|
Loading…
Reference in New Issue