Message ID | 20221221152613.8655-1-vdronov@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp3593590wrn; Wed, 21 Dec 2022 07:41:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXu2aegPPBMMBpyVDCrv9LUPmfDS66x1Vg1lbh2R876L95nSnyjHG7fqVbD6nohEeLVbeOUh X-Received: by 2002:a05:6402:4506:b0:46d:35f6:5a9b with SMTP id ez6-20020a056402450600b0046d35f65a9bmr1937722edb.24.1671637318337; Wed, 21 Dec 2022 07:41:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671637318; cv=none; d=google.com; s=arc-20160816; b=NvFd2mqTJ5IGymE5rxKLVOa9XUiUf8EFZACFjt2QdApcgJUgLXGXxxiYs+BeLNhXn+ liXs072uH8iZfy0/BxtDkcbOkkVMymfF5XL/TdnlT6O07Djw2PUUa5DGJ8px+EZuNo0+ W7IygWN0OkfEKfQcXSubzdsygTFC1beNvLlIc2fgl4oJYFVLZdscwuJg39WsaKVse4a6 UEdOYH+NiX2UJ6qm/ULOAR89wbJhQmAWvU7qOP8/LZrcsM8mUic3Dy9BnJVjyza7YnkV rDMaSGsxTzJ2Doy9KSBQ4ksUkM/RapB1cTRLhE9K71C65yqoD51ED76USPAN6QnY3aZi 1Mjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RL570OHmPW201fZSHberCpl3hdNr7vUODND47Csuw3k=; b=NeDhlAh+NeDJfo1VPaUFhDThFmsFvpz8yrWCWGxpu950m1LPeH/eu996Q3UvtR7MnT qJQnQ8PmgJUZVZAQadXzKjdxZlA9xi92OUt6J7/ZzcRx8tIyUT/MGriObKATWYVds47f jU4Twv0VAsfE8JbKKTOIqBrhAGnkRSwVvjQIW8IIPZhj+HVhQ904/sltEr6u/FMrxtyG q1PxMiW3WDMWw4Z3wkTb0LM4e6yKiwbLNHflgvKFMjEmmol8hTYzcGOSs0BNYlqrkhzy LJe7GZ9y6N8Mh0sfbTDVTMJXNnEqoATAWwH10A9lEspkRr6wIcEOMFqOiVk5uyoO905M Hh5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FqvUAbWs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb7-20020a0564020d0700b0046baedff35bsi16766787edb.291.2022.12.21.07.41.34; Wed, 21 Dec 2022 07:41:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FqvUAbWs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234882AbiLUPfW (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Wed, 21 Dec 2022 10:35:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234739AbiLUPes (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 21 Dec 2022 10:34:48 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F21A428746 for <linux-kernel@vger.kernel.org>; Wed, 21 Dec 2022 07:29:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671636582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RL570OHmPW201fZSHberCpl3hdNr7vUODND47Csuw3k=; b=FqvUAbWswhK1a2zG4D7fWmmBjxaXW3/GRm/t680eoV6xs3nPLLT7i60fQwj2u2N2oIl/M+ 6/5S3unbnT9dhphzPjw2307bsKTEj6EqA+B8sghZr9kbg15KqE4+CYURXh6GEcirGKfk+a XIg9qD9OD+qSkDlfsqObW208RKoA198= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-674-kk_9dkzeN8exWPYguzi-Cg-1; Wed, 21 Dec 2022 10:26:28 -0500 X-MC-Unique: kk_9dkzeN8exWPYguzi-Cg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0F47D18A64E0; Wed, 21 Dec 2022 15:26:28 +0000 (UTC) Received: from rules.brq.redhat.com (ovpn-208-25.brq.redhat.com [10.40.208.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E12340C2064; Wed, 21 Dec 2022 15:26:26 +0000 (UTC) From: Vladis Dronov <vdronov@redhat.com> To: nstange@suse.de Cc: davem@davemloft.net, herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, smueller@chronox.de, vdronov@redhat.com Subject: [PATCH 6/6] crypto: xts - drop redundant xts key check Date: Wed, 21 Dec 2022 16:26:13 +0100 Message-Id: <20221221152613.8655-1-vdronov@redhat.com> In-Reply-To: <20221108142025.13461-1-nstange@suse.de> References: <20221108142025.13461-1-nstange@suse.de> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752838772616277533?= X-GMAIL-MSGID: =?utf-8?q?1752838772616277533?= |
Series |
Trivial set of FIPS 140-3 related changes
|
|
Commit Message
Vladis Dronov
Dec. 21, 2022, 3:26 p.m. UTC
xts_fallback_setkey() in xts_aes_set_key() will now enforce key size
rule in FIPS mode when setting up the fallback algorithm keys, which
makes the check in xts_aes_set_key() redundant or unreachable. So just
drop this check.
xts_fallback_setkey() now makes a key size check in xts_verify_key():
xts_fallback_setkey()
crypto_skcipher_setkey() [ skcipher_setkey_unaligned() ]
cipher->setkey() { .setkey = xts_setkey }
xts_setkey()
xts_verify_key()
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
---
arch/s390/crypto/aes_s390.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c index 526c3f40f6a2..c773820e4af9 100644 --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c @@ -398,10 +398,6 @@ static int xts_aes_set_key(struct crypto_skcipher *tfm, const u8 *in_key, if (err) return err; - /* In fips mode only 128 bit or 256 bit keys are valid */ - if (fips_enabled && key_len != 32 && key_len != 64) - return -EINVAL; - /* Pick the correct function code based on the key length */ fc = (key_len == 32) ? CPACF_KM_XTS_128 : (key_len == 64) ? CPACF_KM_XTS_256 : 0;