crypto: Fix test in get_prng_bytes()
PATCH 1/1 crypto: Fix test in get_prng_bytes()
size_t nbytes cannot be less than 0.
---
Or should this test be removed?
crypto/ansi_cprng.c +1 -1
@@ -192,7 +192,7 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx)int err; -if (nbytes <0 ) +if ((ssize_t )nbytes <0 )return -EINVAL ;spin_lock_bh (&ctx->prng_lock);
Quoted 11 lines · Roel Kluin
size_tnbytes cannot be less than 0.Signed-off-by Roel Kluin <[email protected]>---
Or should this test be removed?crypto/ansi_cprng.c +0
-0
crypto/ansi_cprng.c static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx) · line 198
Quoted 8 lines
crypto/ansi_cprng.c +1
-1@@ -192,7 +192,7 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx)int err; -if (nbytes <0 ) +if ((ssize_t )nbytes <0 )return -EINVAL ;spin_lock_bh (&ctx->prng_lock);
No, you're quite right, its a harmless, but unneeded check. Herbert, could you pull this into cryptodev please? Thank you.
Thanks for the patch Roel.
Neil
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Herbert Xu
maintainerOn Mon, Oct 12, 2009 at 09:51:42AM -0400, Neil Horman wrote:
.
Quoted 10 lines
Quoted 10 lines
Or should this test be removed?
crypto/ansi_cprng.c +0
-0@@ -192,7 +192,7 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx)int err;
Quoted 7 lines
crypto/ansi_cprng.c static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx) · line 198
Quoted 5 lines
crypto/ansi_cprng.c +1
-1-if (nbytes <0 ) +if ((ssize_t )nbytes <0 )return -EINVAL ;spin_lock_bh (&ctx->prng_lock);No, you're quite right, its a harmless, but unneeded check. Herbert, could you pull this into cryptodev please? Thank you.
Hmm, if it's unneeded why don't we just kill it instead?
Thanks,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtRoel Kluin
Acked-by Neil HormanOp 12-10-09 16:07, Herbert Xu schreef:
Quoted 16 lines · Neil Horman
.
Quoted 14 lines
Quoted 14 lines
Or should this test be removed?
crypto/ansi_cprng.c +1
-1@@ -192,7 +192,7 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx)int err; -if (nbytes <0 ) +if ((ssize_t )nbytes <0 )return -EINVAL ;
Quoted 5 lines
Quoted 3 lines
crypto/ansi_cprng.c static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx) · line 198
Quoted 1 line
crypto/ansi_cprng.c +0
-0spin_lock_bh (&ctx->prng_lock);No, you're quite right, its a harmless, but unneeded check. Herbert, could you pull this into cryptodev please? Thank you.
Hmm, if it's unneeded why don't we just kill it instead?
In that case:
-------------------------->8------------------8<------------------------- size_t nbytes cannot be less than 0 and the test was redundant.
---
crypto/ansi_cprng.c +0 -2
@@ -192,9 +192,6 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx)int err; -if (nbytes <0 ) -return -EINVAL ;
Neil Horman
Acked-byQuoted 36 lines · Roel Kluin
Op 12-10-09 16:07, Herbert Xu schreef:
Quoted 16 lines · Neil Horman
.
Quoted 14 lines
Quoted 14 lines
Or should this test be removed?
crypto/ansi_cprng.c +1
-1@@ -192,7 +192,7 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx)int err; -if (nbytes <0 ) +if ((ssize_t )nbytes <0 )return -EINVAL ;Quoted 5 lines
Quoted 3 lines
crypto/ansi_cprng.c static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx) · line 198
Quoted 1 line
crypto/ansi_cprng.c +0
-0spin_lock_bh (&ctx->prng_lock);No, you're quite right, its a harmless, but unneeded check. Herbert, could you pull this into cryptodev please? Thank you.
Hmm, if it's unneeded why don't we just kill it instead?
In that case:
-------------------------->8------------------8<-------------------------size_tnbytes cannot be less than 0 and the test was redundant.Acked-by Neil Horman <[email protected]>Signed-off-by Roel Kluin <[email protected]>---
crypto/ansi_cprng.c +0
-0
crypto/ansi_cprng.c static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx) · line 197
Quoted 9 lines
crypto/ansi_cprng.c +0
-3@@ -192,9 +192,6 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx)int err; -if (nbytes <0 ) -return -EINVAL ; -spin_lock_bh (&ctx->prng_lock); err = -EINVAL ;
There you go, yes :)
Neil
Herbert Xu
maintainerQuoted 2 lines · Neil Horman
Acked-by Neil Horman <[email protected]>
Patch applied to cryptodev. Thanks!
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtQuoted 16 lines · Herbert Xu
On Mon, Oct 12, 2009 at 09:51:42AM -0400, Neil Horman wrote:
.Quoted 14 lines
Quoted 14 lines
Or should this test be removed?
crypto/ansi_cprng.c +1
-1@@ -192,7 +192,7 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx)int err; -if (nbytes <0 ) +if ((ssize_t )nbytes <0 )return -EINVAL ;
Quoted 6 lines
Quoted 3 lines
crypto/ansi_cprng.c static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx) · line 198
Quoted 1 line
crypto/ansi_cprng.c +0
-0spin_lock_bh (&ctx->prng_lock);No, you're quite right, its a harmless, but unneeded check. Herbert, could you pull this into cryptodev please? Thank you.
Hmm, if it's unneeded why don't we just kill it instead?
Sorry, thats what I mean't to say. Can you kill it, or do you want a patch for it?
Neil
Quoted 7 lines
Thanks,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt