mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: nhorman@tuxdriver.com, herbert@gondor.apana.org.au, davem@davemloft.net
Subject: [PATCH] crypto: obscure state information on free
Date: Mon, 11 Aug 2008 16:26:07 -0400	[thread overview]
Message-ID: <20080811202607.GA11527@hmsreliant.think-freely.org> (raw)

Patch to obscure state information on free in prng code.  Keeps prying eyes from
sifting through your trash :)

Regards
Neil

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>


 prng.c |    1 +
 1 file changed, 1 insertion(+)


diff --git a/crypto/prng.c b/crypto/prng.c
index b203093..fc6fa28 100644
--- a/crypto/prng.c
+++ b/crypto/prng.c
@@ -296,6 +296,7 @@ EXPORT_SYMBOL_GPL(alloc_prng_context);
 void free_prng_context(struct prng_context *ctx)
 {
 	crypto_free_cipher(ctx->tfm);
+	memset(ctx, 0, sizeof(struct prng_context));
 	kfree(ctx);
 }
 EXPORT_SYMBOL_GPL(free_prng_context);
-- 
/****************************************************
 * Neil Horman <nhorman@tuxdriver.com>
 * Software Engineer, Red Hat
 ****************************************************/

             reply	other threads:[~2008-08-11 20:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-11 20:26 Neil Horman [this message]
2008-08-14 11:51 ` Herbert Xu
2008-08-14 12:21   ` Neil Horman
2008-08-17 12:20     ` Herbert Xu
2008-08-17 12:23       ` Herbert Xu
2008-08-14 12:23   ` crypto: skcipher - Use RNG interface instead of get_random_bytes Herbert Xu
2008-08-14 15:28     ` Neil Horman
2008-08-17 12:22     ` Herbert Xu

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=20080811202607.GA11527@hmsreliant.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®