generating md5-hashes in modpython fails

44 views
Skip to first unread message

Nikolaus Schlemm

unread,
Jun 27, 2006, 8:55:23 AM6/27/06
to django...@googlegroups.com
hi all,

for some (up to now) unknown reasons the generation of md5-hashes fails in
modpython (for me and at least one other user on irc). I discovered this bug
while switching a django-setup from the builtin dev-server to modpython: it
complained that I had tampered with the session cookies - which I didn't ;)

the session ids looked a little unusual: all hashes started with 16 leading
zeros. So next, I tried generating md5-hashes in django and they also had the
leading zeros PLUS when generating a couple of hashes for different strings
in one request the resulting hashes were all the same. After that I tested
md5 hash generation in "plain" modpy - which had the same problems. the odd
thing is: using the md5-module in "regular" python works totally fine! since
this clearly seems to be a modpy issue, there's a thread on the modpy
mailinglist:
http://modpython.org/pipermail/mod_python/2006-June/021482.html
note that, there already have been confirmations that this is not a general
modpython issue.

the first workaround was to replace md5 with sha - but since that can hardly
be called a solution, I propose that the use of hashing algorithms should
be "uncoupled" from the actual implementation used. the appended diff might
be a start of into that direction, but certainly might need some clean up ;)
--
cheers,

Nikl

svn.diff

Nikolaus Schlemm

unread,
Jun 27, 2006, 9:04:25 AM6/27/06
to django...@googlegroups.com
I forgot to append this file...
--
cheers,

Nikl

hashes.py

Nikolaus Schlemm

unread,
Jul 5, 2006, 10:59:55 AM7/5/06
to django...@googlegroups.com
for anybody who's also experiencing this problem, Alain Tesio mentioned
another odd factor and its workaround on the modpy-mailinglist:

http://modpython.org/pipermail/mod_python/2006-July/021544.html
--
cheers,

Nikl

Reply all
Reply to author
Forward
0 new messages