From: Tom Lendacky <thomas.lendacky@amd.com>
To: <linux-crypto@vger.kernel.org>, Herbert Xu <herbert@gondor.apana.org.au>
Subject: Is a crypto_ahash_init required before invoking crypto_ahash_import?
Date: Thu, 25 Feb 2016 15:56:31 -0600 [thread overview]
Message-ID: <56CF788F.5050209@amd.com> (raw)
I'm seeing an issue on one system that I wasn't seeing on another
system. It turns out that the testmgr sha testing exports an ahash
request context, allocates a new ahash request context and then imports
into that new ahash request context. Since crypto_ahash_init() is not
performed the driver request context could have random data in it,
which ends up causing an error. As part of the import/export support
that I added for the ccp driver I reduced the amount of data that was
exported, but I guess I always assumed that crypto_ahash_init() would
have been called before doing a crypto_ahash_import().
I can fix this in the driver by doing a memset to zero of the request
context area during the import. But I guess I'm also wondering if there
is an expectation/requirement that crypto_ahash_init() be called before
doing an import? If there is the I can add that to the testmgr code
instead.
Thanks,
Tom
next reply other threads:[~2016-02-25 21:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 21:56 Tom Lendacky [this message]
2016-02-25 22:11 ` Is a crypto_ahash_init required before invoking crypto_ahash_import? Herbert Xu
2016-02-25 22:26 ` Tom Lendacky
2016-02-27 7:35 ` 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=56CF788F.5050209@amd.com \
--to=thomas.lendacky@amd.com \
--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