From: Wolfgang Walter <wolfgang.walter@stwm.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: Re: 2.6.32: padlock_sha1 and hmac broken?
Date: Sun, 31 Jan 2010 14:37:55 +0100 [thread overview]
Message-ID: <201001311437.55534.wolfgang.walter@stwm.de> (raw)
In-Reply-To: <20100131092222.GA22508@gondor.apana.org.au>
Am Sonntag, 31. Januar 2010 schrieb Herbert Xu:
> On Sun, Jan 31, 2010 at 03:11:22AM +0100, Wolfgang Walter wrote:
> > Not sure.
> >
> > When I do
> >
> > modprobe tcrypt mode=101
> >
> > I get a kernel oops:
>
> Sorry, this one should have a better chance at working.
>
> diff --git a/drivers/crypto/padlock-sha.c b/drivers/crypto/padlock-sha.c
> index 0af8057..d3a27e0 100644
> --- a/drivers/crypto/padlock-sha.c
> +++ b/drivers/crypto/padlock-sha.c
> @@ -57,6 +57,23 @@ static int padlock_sha_update(struct shash_desc *desc,
> return crypto_shash_update(&dctx->fallback, data, length);
> }
>
> +static int padlock_sha_export(struct shash_desc *desc, void *out)
> +{
> + struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
> +
> + return crypto_shash_export(&dctx->fallback, out);
> +}
> +
> +static int padlock_sha_import(struct shash_desc *desc, const void *in)
> +{
> + struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
> + struct padlock_sha_ctx *ctx = crypto_shash_ctx(desc->tfm);
> +
> + dctx->fallback.tfm = ctx->fallback;
> + dctx->fallback.flags = desc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
> + return crypto_shash_import(&dctx->fallback, in);
> +}
> +
> static inline void padlock_output_block(uint32_t *src,
> uint32_t *dst, size_t count)
> {
> @@ -235,7 +252,10 @@ static struct shash_alg sha1_alg = {
> .update = padlock_sha_update,
> .finup = padlock_sha1_finup,
> .final = padlock_sha1_final,
> + .export = padlock_sha_export,
> + .import = padlock_sha_import,
> .descsize = sizeof(struct padlock_sha_desc),
> + .statesize = sizeof(struct sha1_state),
> .base = {
> .cra_name = "sha1",
> .cra_driver_name = "sha1-padlock",
> @@ -256,7 +276,10 @@ static struct shash_alg sha256_alg = {
> .update = padlock_sha_update,
> .finup = padlock_sha256_finup,
> .final = padlock_sha256_final,
> + .export = padlock_sha_export,
> + .import = padlock_sha_import,
> .descsize = sizeof(struct padlock_sha_desc),
> + .statesize = sizeof(struct sha256_state),
> .base = {
> .cra_name = "sha256",
> .cra_driver_name = "sha256-padlock",
>
> Thanks,
This patch works. /proc/crypto shows
name : authenc(hmac(sha1),cbc(aes))
driver : authenc(hmac(sha1-padlock),cbc-aes-padlock)
module : kernel
priority : 4300
refcnt : 85
selftest : passed
type : aead
async : yes
blocksize : 16
ivsize : 16
maxauthsize : 20
geniv : <built-in>
....
....
and
modprobe tcrypt mode=101
logs nothing.
Thanks a lot,
--
Wolfgang Walter
Studentenwerk München
Anstalt des öffentlichen Rechts
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-01-31 13:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201001300044.15769.wolfgang.walter@stwm.de>
[not found] ` <20100130022721.GA8324@gondor.apana.org.au>
[not found] ` <201001301734.46003.wolfgang.walter@stwm.de>
2010-01-30 22:17 ` 2.6.32: padlock_sha1 and hmac broken? Herbert Xu
2010-01-31 2:11 ` Wolfgang Walter
2010-01-31 9:22 ` Herbert Xu
2010-01-31 13:37 ` Wolfgang Walter [this message]
2010-01-31 23:18 ` 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=201001311437.55534.wolfgang.walter@stwm.de \
--to=wolfgang.walter@stwm.de \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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