All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tapas Sarangi <TSarangi@trustwave.com>
To: Stephan Mueller <smueller@chronox.de>,
	"herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>
Cc: "linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>
Subject: Re: [PATCH] crypto: XTS - remove test that will fail in FIPS mode
Date: Thu, 11 Aug 2016 19:42:54 +0000	[thread overview]
Message-ID: <D3D23ED9.2F9C%tsarangi@trustwave.com> (raw)
In-Reply-To: <D3D10E85.2F74%tsarangi@trustwave.com>

Hi Stephan,

Any other ideas about this problem ? Since XTS is not amongst the
self-tests as you observed, is it safe to disable .fips_allowed for
xts(aes) in testmgr.c ?

Thanks
-Tapas


On 8/10/16, 5:08 PM, "Tapas Sarangi" <TSarangi@trustwave.com> wrote:

>Hi Stephan,
>
>Thanks. Sorry for a late reply to this.
>
>I did test your patch for testmgr.h with the vanilla kernel 4.7 source.
>This doesn¹t solve the xts(aes) self-test failure in FIPS mode. I get the
>exact same error as before.
>
>Thanks
>-Tapas
>
>
>
>
>
>
>
>On 8/10/16, 12:49 AM, "Stephan Mueller" <smueller@chronox.de> wrote:
>
>>Hi Tapas, Herbert,
>>
>>Tapas: this patch should fix it. Can you please test?
>>
>>Herbert: The reason why I have to caught this issue in my tests is the
>>following: I compile xts-aes-aesni statically as you can see below. The
>>self test is marked as passed, although there is no XTS test performed.
>>When you boot in FIPS mode, the testmgr prints out all tests. But XTS is
>>not among them. Do you have an idea why that happens?
>>
>>name         : xts(aes)
>>driver       : xts-aes-aesni
>>module       : kernel
>>priority     : 400
>>refcnt       : 1
>>selftest     : passed
>>internal     : no
>>type         : ablkcipher
>>async        : yes
>>blocksize    : 16
>>min keysize  : 32
>>max keysize  : 64
>>ivsize       : 16
>>geniv        : <default>
>>
>>---8<---
>>
>>In FIPS mode, setting XTS keys where the AES key is identical to the
>>tweak key is forbidden. Thus, the self test with such property will fail
>>in FIPS mode.
>>
>>As we have other tests available for XTS, this patch simply removes the
>>offending test vectors.
>>
>>Reported-by: Tapas Sarangi <TSarangi@trustwave.com>
>>Signed-off-by: Stephan Mueller <smueller@chronox.de>
>>---
>> crypto/testmgr.h | 36 ------------------------------------
>> 1 file changed, 36 deletions(-)
>>
>>diff --git a/crypto/testmgr.h b/crypto/testmgr.h
>>index acb6bbf..e4b58f5 100644
>>--- a/crypto/testmgr.h
>>+++ b/crypto/testmgr.h
>>@@ -10179,24 +10179,6 @@ static struct cipher_testvec
>>tf_lrw_dec_tv_template[] = {
>> static struct cipher_testvec tf_xts_enc_tv_template[] = {
>>      /* Generated from AES-XTS test vectors */
>> {
>>-             .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00",
>>-             .klen   = 32,
>>-             .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00",
>>-             .input  = "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00",
>>-             .ilen   = 32,
>>-             .result = "\x4b\xc9\x44\x4a\x11\xa3\xef\xac"
>>-                       "\x30\x74\xe4\x44\x52\x77\x97\x43"
>>-                       "\xa7\x60\xb2\x45\x2e\xf9\x00\x90"
>>-                       "\x9f\xaa\xfd\x89\x6e\x9d\x4a\xe0",
>>-             .rlen   = 32,
>>-     }, {
>>              .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
>>                        "\x11\x11\x11\x11\x11\x11\x11\x11"
>>                        "\x22\x22\x22\x22\x22\x22\x22\x22"
>>@@ -10522,24 +10504,6 @@ static struct cipher_testvec
>>tf_xts_dec_tv_template[] = {
>>      /* Generated from AES-XTS test vectors */
>>      /* same as enc vectors with input and result reversed */
>>      {
>>-             .key    = "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00",
>>-             .klen   = 32,
>>-             .iv     = "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00",
>>-             .input  = "\x4b\xc9\x44\x4a\x11\xa3\xef\xac"
>>-                       "\x30\x74\xe4\x44\x52\x77\x97\x43"
>>-                       "\xa7\x60\xb2\x45\x2e\xf9\x00\x90"
>>-                       "\x9f\xaa\xfd\x89\x6e\x9d\x4a\xe0",
>>-             .ilen   = 32,
>>-             .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00"
>>-                       "\x00\x00\x00\x00\x00\x00\x00\x00",
>>-             .rlen   = 32,
>>-     }, {
>>              .key    = "\x11\x11\x11\x11\x11\x11\x11\x11"
>>                        "\x11\x11\x11\x11\x11\x11\x11\x11"
>>                        "\x22\x22\x22\x22\x22\x22\x22\x22"
>>--
>>2.7.4
>>
>>
>


________________________________

This transmission may contain information that is privileged, confidential, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is strictly prohibited. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format.

  reply	other threads:[~2016-08-11 19:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 16:34 FIPS mode: modprobe: ERROR: could not insert 'drbg' Tapas Sarangi
2016-08-09 17:05 ` Stephan Mueller
2016-08-09 17:11   ` Tapas Sarangi
2016-08-09 17:52     ` Stephan Mueller
2016-08-09 19:02       ` [PATCH] crypto: DRBG: do not call drbg_instantiate in healt test Stephan Mueller
2016-08-09 21:59         ` Tapas Sarangi
2016-08-10  5:49           ` [PATCH] crypto: XTS - remove test that will fail in FIPS mode Stephan Mueller
2016-08-10 22:08             ` Tapas Sarangi
2016-08-11 19:42               ` Tapas Sarangi [this message]
2016-08-12  8:43                 ` Stephan Mueller
2016-08-16  9:38             ` [PATCH v2] " Stephan Mueller
2016-08-17 14:52               ` Tapas Sarangi
2016-08-17 14:57                 ` Stephan Mueller
2016-08-17 15:09                   ` Tapas Sarangi
2016-08-18  8:20                     ` Stephan Mueller
2016-08-23  9:47               ` Herbert Xu
2016-08-16  9:49         ` [PATCH] crypto: DRBG: do not call drbg_instantiate in healt test 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=D3D23ED9.2F9C%tsarangi@trustwave.com \
    --to=tsarangi@trustwave.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=smueller@chronox.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.