/ domm

I hack Perl for fun and
profit.

Follow me on twitter!
Atom Icom ... on Atom!
<<<<<<<<<<
17.10.2011: Fixing a non-broken search form
30.09.2011: How to get umlauts via AltGr using Debian and xkb
13.09.2011: Twin City Perl Workshop
08.09.2011: Note to self: Keep versions in sync

One of my little tools failed today. You see, I have this small irssi script and a small dancer app that allow me to post microblog messages from IRC to my website. You can read them here.

For some pseudo security I use a shared secret between the two scripts, which is the base for a hashed "token" to authorize a message. And for some strange reasons, I got different tokens on my sending machine and on the receiving machine.

After some debugging I finally found the problem: The same string (which gets URI-encoded before submitting it) and the same secret generated a different hash. Digest::SHA1 wasn't the culprit, so it seems that URI::Encode was causing problems. Or rather, the fact that I had two different version of URI::Encode installed on the two different machines.

So a quick cpanm URI::Encode later, everything was working fine and dandy.

Lesson: If you're doing some communication between different machines, make sure they both use the same versions of modules used to encode/decode/transfer data, before ripping up your code and sprinkling it with loads of warns...

Comments (via disqus)

06.09.2011: My Perl-job-offer reply
20.08.2011: YAPC::Europe 2011
12.08.2011: Vienna.pm barbecue aka KAMEL-Grillen
09.08.2011: App::TimeTracker 2.008 released (finally!)
04.07.2011: Deploying a Dancer/Postgres app on dotCloud
04.09.2010: All following posts were imported from use.perl.org
>>>>>>>>>>