You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jens Gassmann <je...@atomix.de> on 2008/08/23 00:25:33 UTC
Problems with Crypt::RIPEMD160
Hi,
we need RIPEMD160-Hashes for our mod_perl-app. The testscript attached
worked on commandline, but not with mod_perl. There it returns a wrong
Hash => 0123456789abcdeffedcba9876543210f0e1d2c3
Whats wrong? Where could i get start to catch the error?
Attached the for linux amd64 working version of Crypt::RIPEMD160
http://www.atomix.de/Crypt-RIPEMD160-0.05.tar.gz
regards,
Jens
Re: Problems with Crypt::RIPEMD160
Posted by "Dondi M. Stroma" <ds...@verizon.net>.
----- Original Message -----
From: "Jens Gassmann" <je...@atomix.de>
> did you use the http://www.atomix.de/Crypt-RIPEMD160-0.05.tar.gz? There i
> patched like the bugreport described
> http://rt.cpan.org/Public/Bug/Display.html?id=19138
I did now, same problem. It had randomly worked (worked as in didn't
segfault) a few times, but I don't know why, and I can't get it to not
segfault again. But when it did work the digest was also wrong. Oh well, at
least you know it's not just you.
Re: Problems with Crypt::RIPEMD160
Posted by Jens Gassmann <je...@atomix.de>.
Hi Dondi,
> RIPEMD160 is causing a segfault on my machine, on both versions of
> mod_perl. It is segfaulting on the digest() function. It appears there
> is something wrong the module?
did you use the http://www.atomix.de/Crypt-RIPEMD160-0.05.tar.gz? There
i patched like the bugreport described
http://rt.cpan.org/Public/Bug/Display.html?id=19138
regards,
Jens
Re: Problems with Crypt::RIPEMD160
Posted by "Dondi M. Stroma" <ds...@verizon.net>.
----- Original Message -----
From: "Jens Gassmann" <je...@atomix.de>
> Hi,
>
> we need RIPEMD160-Hashes for our mod_perl-app. The testscript attached
> worked on commandline, but not with mod_perl. There it returns a wrong
> Hash => 0123456789abcdeffedcba9876543210f0e1d2c3
>
> Whats wrong? Where could i get start to catch the error?
RIPEMD160 is causing a segfault on my machine, on both versions of mod_perl.
It is segfaulting on the digest() function. It appears there is something
wrong the module?
Re: Problems with Crypt::RIPEMD160
Posted by Perrin Harkins <pe...@elem.com>.
On Mon, Aug 25, 2008 at 4:35 PM, Jens Gassmann <je...@atomix.de> wrote:
> The entire code is written in c :-( only some helper subs are written in
> perl. I could only write perl ....
You may be able to tell what it's trying to do by using tools like
strace. If not, I'd suggest you either contact the author of the C
code or hire a consultant who knows C to help you with this.
- Perrin
Re: Problems with Crypt::RIPEMD160
Posted by Jens Gassmann <je...@atomix.de>.
Hi Perrin,
> You'll need to do some debugging on your code. The things that are
> most likely to be different in a persistent environment like mod_perl
> are environment variables, your current directory, the user you're
> running as (file permission problems often show up this way), CHECK
> and INIT blocks, or assumptions in the code about -M filetests.
> There's a good summary here:
The entire code is written in c :-( only some helper subs are written in
perl. I could only write perl ....
regards,
jens
Re: Problems with Crypt::RIPEMD160
Posted by Perrin Harkins <pe...@elem.com>.
On Fri, Aug 22, 2008 at 6:25 PM, Jens Gassmann <je...@atomix.de> wrote:
> we need RIPEMD160-Hashes for our mod_perl-app. The testscript attached
> worked on commandline, but not with mod_perl. There it returns a wrong Hash
> => 0123456789abcdeffedcba9876543210f0e1d2c3
>
> Whats wrong? Where could i get start to catch the error?
You'll need to do some debugging on your code. The things that are
most likely to be different in a persistent environment like mod_perl
are environment variables, your current directory, the user you're
running as (file permission problems often show up this way), CHECK
and INIT blocks, or assumptions in the code about -M filetests.
There's a good summary here:
http://perl.apache.org/docs/1.0/guide/porting.html
- Perrin
Re: Problems with Crypt::RIPEMD160
Posted by Jens Gassmann <je...@atomix.de>.
Hi Jim,
> # Always do these
> use strict;
> use warnings;
>
> use Crypt::RIPEMD160;
sorry - the example code was too quick and short - i always use strict
and warnings. But with strict and warnings the calculated hash is wrong
too. :-)
Regards,
Jens
Re: Problems with Crypt::RIPEMD160
Posted by Jim Brandt <cb...@buffalo.edu>.
Start with this:
#!/usr/bin/perl
#
# Always do these
use strict;
use warnings;
use Crypt::RIPEMD160;
my $ripemd160 = new Crypt::RIPEMD160;
$ripemd160->add('a');
my $digest = $ripemd160->digest();
print "Content-Type: text/plain\n\n";
print("Digest is " . unpack("H*", $digest) . "\n");
Jens Gassmann wrote:
> Hi,
>
> we need RIPEMD160-Hashes for our mod_perl-app. The testscript attached
> worked on commandline, but not with mod_perl. There it returns a wrong
> Hash => 0123456789abcdeffedcba9876543210f0e1d2c3
>
> Whats wrong? Where could i get start to catch the error?
>
> Attached the for linux amd64 working version of Crypt::RIPEMD160
> http://www.atomix.de/Crypt-RIPEMD160-0.05.tar.gz
>
> regards,
> Jens
>
--
Jim Brandt
Administrative Computing Services
University at Buffalo