X-Git-Url: https://git.distorted.org.uk/~mdw/hippotat/blobdiff_plain/dce21e00c38132b17ec973923f4f7d0cbf47049f..ef04103340f9c2f2666ea3a12bf6420758f2da6d:/hippotatd diff --git a/hippotatd b/hippotatd index bbc8666..05c51bc 100755 --- 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.secret: raise ValueError('bad secret') + 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: