X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=hippotat.git;a=blobdiff_plain;f=hippotatd;h=05c51bcb58a1c57a682221ad9f5873364a19e5d4;hp=bbc866618e37011cdebc101ec620878bd9ea1b67;hb=b3e598b5ea54399982e0183a3e59835b0f82f077;hpb=dce21e00c38132b17ec973923f4f7d0cbf47049f 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: