Andrew Smart wrote:
> Hi folks,
> 
> A short update:
> 
>>> Module: paste.auth.auth_tkt, function encode_ip_timestamp:
>>>    def encode_ip_timestamp(ip, timestamp):
>>>        ip_chars = ''.join(unicode(map(chr, map(int, 
>> ip.split('.')))))
>>>        t = int(timestamp)
>>>        ts = ((t & 0xff000000) >> 24,
>>>              (t & 0xff0000) >> 16,
>>>              (t & 0xff00) >> 8,
>>>              t & 0xff)
>>>        ts_chars = ''.join(map(chr, ts))
>>>        return ip_chars + ts_chars
> 
> 
> If the chr() functions are replaced by unichr() then there are still
> problems later on.
> The trouble is then caused by the ts_chars and the binary manipulations
> there.
> 
> I took a much simpler approach manipulation the timestamp string (only
> reversing it) and now it works.
> 
> Maybe some of the python guru's looks over this issue... Or maybe just take
> a different approach to calculate the digest.

This code copies mod_auth_tkt's signature, so it has to be calculated 
exactly the way it is; if it doesn't, then it's just a custom signed 
cookie, and paste.auth.cookie might be a better choice in that case.

-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org
             : Write code, do good : http://topp.openplans.org/careers

_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to