From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Jarod Wilson <jarod@redhat.com>
Cc: linux-crypto@vger.kernel.org, linux-s390@vger.kernel.org,
linux-kernel@vger.kernel.org,
Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [PATCH] crypto: s390 des3 - permit weak keys unless REQ_WEAK_KEY set
Date: Thu, 11 Jun 2009 15:38:59 +0200 [thread overview]
Message-ID: <20090611133859.GC3146@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <200906081332.10608.jarod@redhat.com>
On Mon, Jun 08, 2009 at 01:32:09PM -0400, Jarod Wilson wrote:
> Just started running fips cavs test vectors through an s390x system
> for giggles, and discovered that I missed patching s390's arch-specific
> des3 implementation w/an earlier des3 patch to permit weak keys.
>
> This change adds the same flag tweaks as ad79cdd77fc1466e45cf923890f66bcfe7c43f12
> for s390's des3 implementation, yields expected test results now.
>
> Signed-off-by: Jarod Wilson <jarod@redhat.com>
>
> ---
> arch/s390/crypto/des_s390.c | 11 ++++++-----
> 1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/arch/s390/crypto/des_s390.c b/arch/s390/crypto/des_s390.c
> index 4aba83b..2bc479a 100644
> --- a/arch/s390/crypto/des_s390.c
> +++ b/arch/s390/crypto/des_s390.c
> @@ -250,8 +250,9 @@ static int des3_128_setkey(struct crypto_tfm *tfm, const u8 *key,
> const u8 *temp_key = key;
> u32 *flags = &tfm->crt_flags;
>
> - if (!(memcmp(key, &key[DES_KEY_SIZE], DES_KEY_SIZE))) {
> - *flags |= CRYPTO_TFM_RES_BAD_KEY_SCHED;
> + if (!(memcmp(key, &key[DES_KEY_SIZE], DES_KEY_SIZE)) &&
> + (*flags & CRYPTO_TFM_REQ_WEAK_KEY)) {
> + *flags |= CRYPTO_TFM_RES_WEAK_KEY;
> return -EINVAL;
I think this should go in via crypt-dev. Herbert?
next prev parent reply other threads:[~2009-06-11 13:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-08 17:32 Jarod Wilson
2009-06-11 13:38 ` Heiko Carstens [this message]
2009-06-18 11:53 ` 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=20090611133859.GC3146@osiris.boeblingen.de.ibm.com \
--to=heiko.carstens@de.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=jarod@redhat.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@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®