public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] getrandom02: relax check for returned data
Date: Tue, 7 Feb 2017 11:15:28 -0500 (EST)	[thread overview]
Message-ID: <1487036067.1086032.1486484128036.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20170207153352.GB3595@rei.suse.cz>





----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Tuesday, 7 February, 2017 4:33:52 PM
> Subject: Re: [LTP] [PATCH] getrandom02: relax check for returned data
> 
> Hi!
> > +			} else {
> >  				tst_resm(TPASS, "getrandom returned %ld",
> >  						TEST_RETURN);
> > +				tmp = 0;
> > +				for (j = 0; j < TEST_RETURN; j++)
> > +					tmp |= buf[j];
> > +				if (tmp == 0)
> > +					tst_resm(TWARN, "all bytes from random"
> > +						" buffer are zero?");
> 
> This wouldn't for instance when the random output is filled with
> non-zero constant bytes...
> 
> What about just fixing the max value to something as:
> 
> max = 3 + nb * 0.2;
> 
> The constat part should handle cases with small buffer and a few
> repeating characters while for larger buffer it's neglectible.

In that case we may as well skip the check for small buffers.
What size would make reasonably large sample? 64?

> 
> --
> Cyril Hrubis
> chrubis@suse.cz
> 

  reply	other threads:[~2017-02-07 16:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06 12:13 [LTP] [PATCH] getrandom02: relax check for returned data Jan Stancek
2017-02-07 15:33 ` Cyril Hrubis
2017-02-07 16:15   ` Jan Stancek [this message]
2017-02-07 17:30     ` Cyril Hrubis
2017-02-08 11:23       ` Jiri Jaburek
2017-02-08 13:32         ` Cyril Hrubis
2017-02-08 13:14       ` Jan Stancek
2017-02-08 14:08         ` Cyril Hrubis
2017-02-08 14:11           ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487036067.1086032.1486484128036.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox