Remove ClientList config option

This commit is contained in:
Jakob Aarøe Dam 2015-04-28 12:58:26 +02:00
parent fdfe54dcf7
commit 973ef3a63e
2 changed files with 18 additions and 31 deletions

View file

@ -15,7 +15,7 @@ Public Class RDSFactor
Public Shared ADField As String = "" Public Shared ADField As String = ""
Public Shared ADMailField As String = "" Public Shared ADMailField As String = ""
Public Shared EnableOTP As Boolean Public Shared EnableOTP As Boolean
Public Shared secrets As NASAuthList Public Shared secrets As New NASAuthList
Public Shared SessionTimeOut As Integer = 30 ' in minutes Public Shared SessionTimeOut As Integer = 30 ' in minutes
Public Shared LaunchTimeOut As Integer = 30 ' in seconds Public Shared LaunchTimeOut As Integer = 30 ' in seconds
@ -57,13 +57,6 @@ Public Class RDSFactor
End Sub End Sub
Public Sub StartUpServer() Public Sub StartUpServer()
secrets = New NASAuthList
For Each cl As DictionaryEntry In clientHash
ServerLog("Adding Shared Secrets to Radius Server")
secrets.AddSharedSecret(cl.Key, cl.Value)
Next
Try Try
server = New RADIUSServer(serverPort, AddressOf ProcessPacket, secrets) server = New RADIUSServer(serverPort, AddressOf ProcessPacket, secrets)
ServerLog("Starting Radius Server on Port " & serverPort & " ...OK") ServerLog("Starting Radius Server on Port " & serverPort & " ...OK")
@ -194,15 +187,10 @@ Public Class RDSFactor
End If End If
Dim ClientList As String = "" For Each client In RConfig.GetSection("clients").Keys
ClientList = RConfig.GetKeyValue("RDSFactor", "ClientList") Dim address = client.Name
ServerLog("Adding Shared Secret for: " & address)
Dim ClientArray() As String secrets.AddSharedSecret(address, client.Value)
ClientArray = Split(ClientList, ",")
For i As Integer = 0 To ClientArray.Length - 1
ServerLog("Loading Shared Secret for Client: " & ClientArray(i))
clientHash.Add(ClientArray(i), RConfig.GetKeyValue("Clients", ClientArray(i)))
Next Next
If ConfOk = True Then If ConfOk = True Then

View file

@ -1,18 +1,17 @@
[RDSFactor] [RDSFactor]
ClientList=127.0.0.1
SenderEmail=noreply@example.com
ADField=telephoneNumber ADField=telephoneNumber
EnableOTP=0
Provider=https://www.cpsms.dk/sms/?username=myuser&password=mypassword&recipient=***NUMBER***&message=***TEXTMESSAGE***&from=CPSMS
Debug=1
MailServer=
TSGW=1
LDAPDomain=ad.example.com
EnableEmail=0
USELOCALMODEM=0
SMSC=+4540390999
EnableSMS=1
COMPORT=com1
ADMailfield=mail ADMailfield=mail
Debug=1
EnableOTP=0
EnableSMS=1
LDAPDomain=ad.example.com
MailServer=
Provider=https://www.cpsms.dk/sms/?username=myuser&password=mypassword&recipient=***NUMBER***&message=***TEXTMESSAGE***&from=CPSMS
EnableEmail=0
SenderEmail=noreply@example.com
COMPORT=com1
SMSC=+4540390999
USELOCALMODEM=0
[Clients] [Clients]
127.0.0.1=helloworld 127.0.0.1=helloworld