]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Fix/update comments in fake-*-server.py scripts
authorDaniel Lenski <dlenski@gmail.com>
Sat, 13 Nov 2021 18:35:36 +0000 (10:35 -0800)
committerDaniel Lenski <dlenski@gmail.com>
Sun, 14 Nov 2021 18:13:19 +0000 (10:13 -0800)
Also adds a stub to make sure that 'fake-juniper-server.py' rejects attempts
to start speaking the Junos/Pulse protocol, rather than the Juniper/oNCP
protocol.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
tests/fake-fortinet-server.py
tests/fake-gp-server.py
tests/fake-juniper-server.py

index ce0558f3d07d3d12a0c2242cd5dce6d8f009627f..505eebfbad3033e45409750c31d621be55490296 100755 (executable)
@@ -27,7 +27,7 @@
 #    POST /remote/logincheck (with username and credential fields)
 #      No 2FA)   Completes the login
 #      With 2FA) Returns a 2FA challenge
-#    POST /remote/logincheck (with username, code, and challenge response fields)
+#    POST /remote/logincheck (with username and 2FA response fields)
 #
 # It does not actually validate the credentials in any way, but attempts to
 # verify their consistency from one request to the next, by saving their
index a5e5ece30c037ecba5b71e0fa9aea9f8839843a0..1e6b6ead613e77e8f04a340734c3183fe45e7c62 100755 (executable)
@@ -245,7 +245,7 @@ def getconfig():
     return '''<response>{}<ssl-tunnel-url>/ssl-tunnel-connect.sslvpn</ssl-tunnel-url></response>'''.format(addrs)
 
 
-# Respond to gateway getconfig request
+# Respond to gateway hipreportcheck request
 @app.route('/ssl-vpn/hipreportcheck.esp', methods=('POST',))
 @check_form_against_session('user', 'portal', 'domain', 'authcookie', 'computer')
 def hipcheck():
index a8b77e3101e3f5e242b16dc9e1edb28a2647c6b3..224b9c0abe387082e9ea0f162883469f6cc2eab9 100755 (executable)
@@ -76,6 +76,10 @@ def check_form_against_session(*fields, use_query=False):
 #   token/2FA form name (can be frmLogin, for 2-password-in-one-form option)]
 @app.route('/')
 def root():
+    # We don't support the Junos/Pulse protocol (which starts with this request)
+    if request.headers.get('Upgrade') == 'IF-T/TLS 1.0' and request.headers.get('Content-Type') == 'EAP':
+        return abort(501)
+
     realms = request.args.get('realms')
     roles = request.args.get('roles')
     confirm = bool(request.args.get('confirm'))