Skip Menu |

This queue is for tickets about the Bytes-Random-Secure CPAN distribution.

Report information
The Basics
Id: 113975
Status: rejected
Priority: 0/
Queue: Bytes-Random-Secure

People
Owner: Nobody in particular
Requestors: puma [...] luotisade.net
Cc:
AdminCc:

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



Subject: random_string_from() cant get it to work
Date: Mon, 25 Apr 2016 19:10:13 +0300
To: bug-bytes-random-secure [...] rt.cpan.org
From: Ville Ahtola <puma [...] luotisade.net>
So I did some tests and was able to reliably reproduce two kinds of errors with the random_string_from() using two small scripts. Show quoted text
--- START PERL SCRIPT --- use Bytes::Random::Secure; my $random = Bytes::Random::Secure->new( NonBlocking => 1 ); my $passwd = $random->random_string_from( 'abcde', 3 ); --- END PERL SCRIPT --- This first example gives error message of "Byte count must be a positive integer." and a return code of 9.
--- START PERL SCRIPT --- use Bytes::Random::Secure; my $random = Bytes::Random::Secure->new( NonBlocking => 1 ); my $passwd = $random->random_string_from( 3, 'abcde' ); --- END PERL SCRIPT --- This tries to read from a blocking entropy pool, stalls, and hangs for so long that I couldn't be bothered to find out what it eventually outputs. I'd be curious if you can reproduce this behaviour, or is the problem with my system or the debian package.
Subject: Re: [rt.cpan.org #113975] random_string_from() cant get it to work
Date: Mon, 25 Apr 2016 10:30:38 -0600
To: bug-Bytes-Random-Secure [...] rt.cpan.org
From: David Oswald <daoswald [...] gmail.com>
Thanks for the feedback. I'll look into it within the next day or so. On Mon, Apr 25, 2016 at 10:10 AM, Ville Ahtola via RT < bug-Bytes-Random-Secure@rt.cpan.org> wrote: Show quoted text
> Mon Apr 25 12:10:33 2016: Request 113975 was acted upon. > Transaction: Ticket created by puma@luotisade.net > Queue: Bytes-Random-Secure > Subject: random_string_from() cant get it to work > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: puma@luotisade.net > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=113975 > > > > So I did some tests and was able to reliably reproduce two kinds of errors > with the random_string_from() using two small scripts. > > > --- START PERL SCRIPT --- > use Bytes::Random::Secure; > my $random = Bytes::Random::Secure->new( NonBlocking => 1 ); > my $passwd = $random->random_string_from( 'abcde', 3 ); > --- END PERL SCRIPT --- > > This first example gives error message of "Byte count must be a positive > integer." and a return code of 9. > > > > --- START PERL SCRIPT --- > use Bytes::Random::Secure; > my $random = Bytes::Random::Secure->new( NonBlocking => 1 ); > my $passwd = $random->random_string_from( 3, 'abcde' ); > --- END PERL SCRIPT --- > > This tries to read from a blocking entropy pool, stalls, and hangs for so > long that I couldn't be bothered to find out what it eventually outputs. > > > I'd be curious if you can reproduce this behaviour, or is the problem with > my system or the debian package. > >
-- David Oswald daoswald@gmail.com
On Mon Apr 25 09:10:33 2016, puma@luotisade.net wrote: Show quoted text
> So I did some tests and was able to reliably reproduce two kinds of errors > with the random_string_from() using two small scripts. > > > --- START PERL SCRIPT --- > use Bytes::Random::Secure; > my $random = Bytes::Random::Secure->new( NonBlocking => 1 ); > my $passwd = $random->random_string_from( 'abcde', 3 ); > --- END PERL SCRIPT --- > > This first example gives error message of "Byte count must be a positive > integer." and a return code of 9.
In this example, since you are using the Object Oriented interface to Bytes::Random::Secure, you should be using the string_from method (not the random_string_from function). Here is an example: perl -MBytes::Random::Secure -e 'my $r = Bytes::Random::Secure->new(NonBlocking => 1); my $p = $r->string_from(q{abcde}, 3); print "$p\n";' Show quoted text
> --- START PERL SCRIPT --- > use Bytes::Random::Secure; > my $random = Bytes::Random::Secure->new( NonBlocking => 1 ); > my $passwd = $random->random_string_from( 3, 'abcde' ); > --- END PERL SCRIPT --- > > This tries to read from a blocking entropy pool, stalls, and hangs for so > long that I couldn't be bothered to find out what it eventually outputs. > > > I'd be curious if you can reproduce this behaviour, or is the problem with > my system or the debian package.
I haven't witnessed blocking when a non-blocking entropy source is requested. However, that last line should be: my $passwd = $random->string_from('abcde', 3);
Subject: Re: [rt.cpan.org #113975] random_string_from() cant get it to work
Date: Tue, 26 Apr 2016 03:11:11 +0300
To: "David J. Oswald via RT" <bug-Bytes-Random-Secure [...] rt.cpan.org>
From: Ville Ahtola <puma [...] luotisade.net>
Yes. You are right. I got the random_string_from() and string_from() all mixed up. So no bugs here afterall. Sorry for the false alarm.
Rejecting because it was just operator error.