should work with multiple openvpn servers

the goal is to have an udp instance, and a tcp/443 one

can handle connected and disconnected messages
This commit is contained in:
Xavier Henner
2019-07-10 15:47:55 +02:00
parent 274e824630
commit 44cfdea6ed
4 changed files with 339 additions and 199 deletions

8
otp.go
View File

@@ -13,6 +13,14 @@ func (s *OpenVpnMgt) GenerateOTP(user string) ([]string, error) {
// return s.GenerateOTPGeneric(user, 60, "sha256", 30, 8)
// }
func (s *OpenVpnMgt) TokenPassword(c *vpnSession) (bool, string) {
//TODO implement that correcly
if c.password == "maith1wiePuw3ieb4heiNie5y" {
return true, "maith1wiePuw3ieb4heiNie5y"
}
return false, "maith1wiePuw3ieb4heiNie5y"
}
func (s *OpenVpnMgt) GenerateOTPGeneric(user string, period int, algo string, secretLen int, digits int) ([]string, error) {
codes := []string{}
now := time.Now()