Commits

Martin von Löwis committed 6dd1e0c

Use DH only for http URLs again.
Print URL in test server.

  • Participants
  • Parent commits 1f7d6bd

Comments (0)

Files changed (1)

         'openid.assoc_type':"HMAC-SHA1",
         'openid.session_type':"no-encryption",
         }
-    if 1 or url.startswith('http:'):
+    if url.startswith('http:'):
         # Use DH exchange
         data['openid.session_type'] = "DH-SHA1"
         # Private key: random number between 1 and dh_prime-1
     data = parse_response(res.read())
     if 'error' in data:
         raise ValueError, "associate failed: "+data['error']
-    if 1 or url.startswith('http:'):
+    if url.startswith('http:'):
         enc_mac_key = base64.b64decode(data['enc_mac_key'])
         dh_server_public = unbtwoc(base64.b64decode(data['dh_server_public']))
         # shared secret: sha1(2^(server_priv*priv) mod prime) xor enc_mac_key
         base_url = sys.argv[1]
     else:
         base_url = "http://" + socket.getfqdn() + ":8000/"
+    print "Listening on", base_url
     Handler.base_url = base_url
     BaseHTTPServer.HTTPServer.address_family = socket.AF_INET6
     httpd = BaseHTTPServer.HTTPServer(('', 8000), Handler)