chiark / gitweb /
ensure mtu is in the ipif substitution set
[hippotat.git] / hippotatd
index 8fb0e0c7333163366050e2633ecff42e36be06ee..05c51bcb58a1c57a682221ad9f5873364a19e5d4 100755 (executable)
--- a/hippotatd
+++ b/hippotatd
@@ -174,7 +174,7 @@ def process_request(request, desca):
   # find client, update config, etc.
   metadata = request.args[b'm'][0]
   metadata = metadata.split(b'\r\n')
-  (ci_s, pw, tro, cto) = metadata[0:4]
+  (ci_s, token, tro, cto) = metadata[0:4]
   desca['m[0,2:3]'] = [ci_s, tro, cto]
   ci_s = ci_s.decode('utf-8')
   tro = int(tro); desca['tro']= tro
@@ -182,7 +182,7 @@ def process_request(request, desca):
   ci = ipaddr(ci_s)
   desca['ci'] = ci
   cl = clients[ci]
-  if pw != cl.cc.password: raise ValueError('bad password')
+  authtoken_check(cl.cc.secret, token, cl.cc.max_clock_skew)
   desca['pwok']=True
 
   if tro != cl.cc.target_requests_outstanding:
@@ -311,6 +311,7 @@ def process_cfg(_opts, putative_servers, putative_clients):
     if not sections: continue
     cfg_process_client_limited(cc,c.server,sections, 'max_batch_down')
     cfg_process_client_limited(cc,c.server,sections, 'max_queue_time')
+    cc.max_clock_skew = cfg_search(cfg.getint, 'max_clock_skew', sections)
     Client(ci, cc)
 
   try: