| 32 | } |
| 33 | |
| 34 | func ReadCustomAuthFile(log *logrus.Logger) bool { |
| 35 | if IsFile(customAuth) == false { |
| 36 | return false |
| 37 | } else { |
| 38 | bytes, err := os.ReadFile(customAuth) |
| 39 | if err != nil { |
| 40 | log.Errorln("ReadFile CustomAuth Error", err) |
| 41 | return false |
| 42 | } |
| 43 | |
| 44 | nowContent := string(bytes) |
| 45 | authStings := strings.Split(nowContent, "@@@@") |
| 46 | if len(authStings) != 3 { |
| 47 | log.Errorln("ReadFile CustomAuth Error", err) |
| 48 | return false |
| 49 | } |
| 50 | |
| 51 | SetBaseKey(authStings[0]) |
| 52 | SetAESKey16(authStings[1]) |
| 53 | SetAESIv16(authStings[2]) |
| 54 | |
| 55 | log.Infoln("Use CustomAuth") |
| 56 | return true |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | const ( |
| 61 | defPort = 19035 |