From: Stephan Mueller <smueller@chronox.de>
To: herbert@gondor.apana.org.au
Cc: linux-crypto@vger.kernel.org
Subject: Re: [PATCH v2 1/3] crypto: drbg - fix drbg_generate return val check
Date: Sat, 18 Apr 2015 17:48:41 +0200 [thread overview]
Message-ID: <3715518.jItNN4ZoNa@myon.chronox.de> (raw)
In-Reply-To: <2357671.arYJ3FSGcR@myon.chronox.de>
Am Samstag, 18. April 2015, 16:42:20 schrieb Stephan Mueller:
Hi Stephan,
> The drbg_generate returns 0 in success case. That means that
> drbg_generate_long will always only generate drbg_max_request_bytes at
> most. Longer requests will be truncated to drbg_max_request_bytes.
>
> Reported-by: Herbert Xu <herbert@gondor.apana.org.au>
> Signed-off-by: Stephan Mueller <smueller@chronox.de>
> ---
> crypto/drbg.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/crypto/drbg.c b/crypto/drbg.c
> index b69409c..74f7c1e 100644
> --- a/crypto/drbg.c
> +++ b/crypto/drbg.c
> @@ -1450,7 +1450,7 @@ static int drbg_generate_long(struct drbg_state *drbg,
> slice = ((buflen - len) / drbg_max_request_bytes(drbg));
> chunk = slice ? drbg_max_request_bytes(drbg) : (buflen - len);
> tmplen = drbg_generate(drbg, buf + len, chunk, addtl);
> - if (0 >= tmplen)
> + if (0 > tmplen)
Please disregard this patch :-(
I need to update that one further -- my preliminary tests worked but more
extensive tests showed that the patch is wrong.
> return tmplen;
> len += tmplen;
> } while (slice > 0 && (len < buflen));
--
Ciao
Stephan
next prev parent reply other threads:[~2015-04-18 15:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-18 14:41 [PATCH v2 0/3] crypto: drbg - revamp locking Stephan Mueller
2015-04-18 14:42 ` [PATCH v2 1/3] crypto: drbg - fix drbg_generate return val check Stephan Mueller
2015-04-18 15:48 ` Stephan Mueller [this message]
2015-04-18 14:45 ` [PATCH v2 2/3] crypto: drbg - replace spinlock with mutex Stephan Mueller
2015-04-18 14:46 ` [PATCH v2 3/3] crypto: drbg - leave cipher handles operational Stephan Mueller
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=3715518.jItNN4ZoNa@myon.chronox.de \
--to=smueller@chronox.de \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
/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