mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-12 04:05:53 +02:00
openvpn-authenticator: Return only available data
For connections which have not enabled OTP return connection name and common_name attributes only.
This commit is contained in:
committed by
Michael Tremer
parent
74ab6f9fc0
commit
a4a42daeea
@@ -286,15 +286,19 @@ class OpenVPNAuthenticator(object):
|
||||
continue
|
||||
|
||||
# Return match!
|
||||
return {
|
||||
"name" : row[2],
|
||||
"common_name" : row[3],
|
||||
|
||||
conn = {}
|
||||
if len(row) < 45:
|
||||
# General connection data
|
||||
conn['name'] = row[2]
|
||||
conn['common_name'] = row[3]
|
||||
elif len(row) >= 45:
|
||||
# TOTP options
|
||||
"totp_protocol" : row[43],
|
||||
"totp_status" : row[44],
|
||||
"totp_secret" : row[45],
|
||||
}
|
||||
conn['totp_protocol'] = row[43]
|
||||
conn['totp_status'] = row[44]
|
||||
conn['totp_secret'] = row[45]
|
||||
|
||||
return conn
|
||||
|
||||
|
||||
def _check_totp_token(self, token, secret):
|
||||
p = subprocess.run(
|
||||
|
||||
Reference in New Issue
Block a user