Skip Menu |

This queue is for tickets about the Win32-CryptData CPAN distribution.

Report information
The Basics
Id: 52840
Status: open
Priority: 0/
Queue: Win32-CryptData

People
Owner: Nobody in particular
Requestors: paul-bitcard [...] kittyheads.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.02
Fixed in: (no value)



Subject: \$OptionalEntropy causes error if set to undef
Reading the POD for this module, it suggests that one can set \$OptionalEntropy to a value of undef. Doing so results in the following: Use of uninitialized value in length at C:/Perl/site/lib/Win32/CryptData.pm line 129. Error: The stub received bad data To reproduce, use the example provided in the POD, setting $OptionalEntropy to undef. Perl binary details from perl -v: This is perl, v5.10.0 built for MSWin32-x86-multi-thread (with 5 registered patches, see perl -V for more detail) Copyright 1987-2007, Larry Wall Binary build 1004 [287188] provided by ActiveState http://www.ActiveState.com Built Sep 3 2008 13:16:37
Line 129: could be changed to: my $pOptionalEntropy = pack("LL", (defined $$OptionalEntropy ? length ($$OptionalEntropy) : 0)+1, unpack("L!", pack("P", ($$OptionalEntropy || 0)))); Similarly, line 218 needs to be updated for decryption: my $pOptionalEntropy = pack('LL', (defined $$OptionalEntropy ? length ($$OptionalEntropy) : 0)+1, unpack('L!', pack('P', ($$OptionalEntropy || 0)))); Complete testing should be done. This quick fix seemed to work for me. Regards, Paul On Wed Dec 16 15:56:37 2009, hzlnt7 wrote: Show quoted text
> Reading the POD for this module, it suggests that one can set > \$OptionalEntropy to a value of undef. Doing so results in the > following: > > Use of uninitialized value in length at > C:/Perl/site/lib/Win32/CryptData.pm line > 129. > Error: The stub received bad data > > To reproduce, use the example provided in the POD, setting > $OptionalEntropy to undef. > > Perl binary details from perl -v: > This is perl, v5.10.0 built for MSWin32-x86-multi-thread > (with 5 registered patches, see perl -V for more detail) > > Copyright 1987-2007, Larry Wall > > Binary build 1004 [287188] provided by ActiveState > http://www.ActiveState.com > Built Sep 3 2008 13:16:37