Skip to content
This repository was archived by the owner on Apr 9, 2020. It is now read-only.

Commit 0fd1c39

Browse files
committed
Use method-auth to enable OTA.
1 parent 0206d55 commit 0fd1c39

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ AES is recommended for shadowsocks-go. [Intel AES Instruction Set](http://en.wik
5757

5858
### One Time Auth
5959

60-
Append `-ota` to the encryption method to enable [One Time Auth (OTA)](https://shadowsocks.org/en/spec/one-time-auth.html).
60+
Append `-auth` to the encryption method to enable [One Time Auth (OTA)](https://shadowsocks.org/en/spec/one-time-auth.html).
6161

6262
- For server: this will **force client use OTA**, non-OTA connection will be dropped. Otherwise, both OTA and non-OTA clients can connect
6363
- For client: the `-A` command line option can also enable OTA

cmd/shadowsocks-local/local.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func parseServerConfig(config *ss.Config) {
174174
if len(config.ServerPassword) == 0 {
175175
method := config.Method
176176
if config.Auth {
177-
method += "-ota"
177+
method += "-auth"
178178
}
179179
// only one encryption table
180180
cipher, err := ss.NewCipher(method, config.Password)
@@ -381,7 +381,7 @@ func main() {
381381
cmdConfig.Server = cmdServer
382382
ss.SetDebug(debug)
383383

384-
if strings.HasSuffix(cmdConfig.Method, "-ota") {
384+
if strings.HasSuffix(cmdConfig.Method, "-auth") {
385385
cmdConfig.Method = cmdConfig.Method[:len(cmdConfig.Method)-4]
386386
cmdConfig.Auth = true
387387
}

cmd/shadowsocks-server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ func main() {
345345

346346
ss.SetDebug(debug)
347347

348-
if strings.HasSuffix(cmdConfig.Method, "-ota") {
348+
if strings.HasSuffix(cmdConfig.Method, "-auth") {
349349
cmdConfig.Method = cmdConfig.Method[:len(cmdConfig.Method)-4]
350350
cmdConfig.Auth = true
351351
}

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"server_port":8388,
44
"local_port":1080,
55
"password":"barfoo!",
6-
"method": "aes-128-cfb-ota",
6+
"method": "aes-128-cfb-auth",
77
"timeout":600
88
}

shadowsocks/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ func ParseConfig(path string) (config *Config, err error) {
8787
return nil, err
8888
}
8989
readTimeout = time.Duration(config.Timeout) * time.Second
90-
if strings.HasSuffix(strings.ToLower(config.Method), "-ota") {
91-
config.Method = config.Method[:len(config.Method)-4]
90+
if strings.HasSuffix(strings.ToLower(config.Method), "-auth") {
91+
config.Method = config.Method[:len(config.Method)-5]
9292
config.Auth = true
9393
}
9494
return

shadowsocks/encrypt.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ func NewCipher(method, password string) (c *Cipher, err error) {
184184
return nil, errEmptyPassword
185185
}
186186
var ota bool
187-
if strings.HasSuffix(strings.ToLower(method), "-ota") {
188-
method = method[:len(method)-4] // len("-ota") = 4
187+
if strings.HasSuffix(strings.ToLower(method), "-auth") {
188+
method = method[:len(method)-5] // len("-auth") = 5
189189
ota = true
190190
} else {
191191
ota = false

0 commit comments

Comments
 (0)