Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C4BDC43381 for ; Wed, 10 Feb 2021 07:24:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5482464E6C for ; Wed, 10 Feb 2021 07:24:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232466AbhBJHYi (ORCPT ); Wed, 10 Feb 2021 02:24:38 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:50300 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232435AbhBJHYX (ORCPT ); Wed, 10 Feb 2021 02:24:23 -0500 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1l9jqX-0001IE-IT; Wed, 10 Feb 2021 18:23:34 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Wed, 10 Feb 2021 18:23:33 +1100 Date: Wed, 10 Feb 2021 18:23:33 +1100 From: Herbert Xu To: Daniele Alessandrelli Cc: daniele.alessandrelli@intel.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] crypto: keembay-ocs-aes - Fix 'q' assignment during CCM B0 generation Message-ID: <20210210072333.GI4493@gondor.apana.org.au> References: <20210203154210.246667-1-daniele.alessandrelli@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210203154210.246667-1-daniele.alessandrelli@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Feb 03, 2021 at 03:42:10PM +0000, Daniele Alessandrelli wrote: > From: Daniele Alessandrelli > > In ocs_aes_ccm_write_b0(), 'q' (the octet length of the binary > representation of the octet length of the payload) is set to 'iv[0]', > while it should be set to 'iv[0] & 0x7' (i.e., only the last 3 > bits of iv[0] should be used), as documented in NIST Special Publication > 800-38C: > https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38c.pdf > > In practice, this is not an issue, since 'iv[0]' is checked to be in the > range [1-7] by ocs_aes_validate_inputs(), but let's fix the assignment > anyway, in order to make the code more robust. > > Signed-off-by: Daniele Alessandrelli > --- > drivers/crypto/keembay/ocs-aes.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt