Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4597181ybi; Tue, 30 Jul 2019 04:57:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGRtD8eFYUW7e+36JM0o9Bg5krI5BiyY1WEWgWXSYsLz3E2SoAxV7I4cn/w6fRnskBwqbq X-Received: by 2002:a17:902:934a:: with SMTP id g10mr116973084plp.18.1564487865160; Tue, 30 Jul 2019 04:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564487865; cv=none; d=google.com; s=arc-20160816; b=gdo3Yxu4E0uM3jM/HTdaV9pm68ShhTnl+fGISRVsUR4dcdEICBzMsbhQ6yhVbIDOJn n/zaiWtRPb+Z9vXvFasT2aPrq3yd/blMXleitqNDkU0t5GoCrsP11QC78koou3LYTvY1 dLmgUc1myhiRV0VSKm7k28yo/v253uIdcNzUsGKcSX8p5OYOa1XgCoKLWv7Z+ADnHBLy A2Q6blOL7MqBu5B3xPc9JZMwR/61O00nEjkODbBzhTKhHv38Pg6/KpatXk5SsNM2j8jX tr6ywK/T/FY6zy/dtTjSOGH15T3vxVVeTECc0WXRK2KRLzdgmtPgJH4GQbOeooKKFyzN H1sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=UO17OhRqK+XkkgFC91WOsMTDUD5E7X+FpTMz4B+XfHA=; b=rU9n2yd7PiQrVQ16NnVIYbk2z9y76YoGycQPpuDJ5BNEUazFkhIQV1iqPrSOxiMdrW Lapv/puadyi9A7EKTkFZ9xsS9OWL+aKq7lgVs4DIAX3VLBWIvJ63JzC5j+ZCdUsFsfhy XxHfHQsVM927jeK5Kr0DJgCHbw3Z59GYA0vHckjlA9yJ3/WFMiVp5pFSPwcHOUTBXzde JwaYTJpB7ELh+wCI0EZgevkbkm64avDbymfAey1TjHUg3h2dzYlrUF5WJi+D0K3QBIHo zOO/eZ0msb65thX5t8W0xsdfeQtAgWpXVBxv/7k6j8NbB+VvyUKUUydTGFw28XLNEgez TdKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x125si30838763pgx.332.2019.07.30.04.57.30; Tue, 30 Jul 2019 04:57:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729538AbfG3Kdt (ORCPT + 99 others); Tue, 30 Jul 2019 06:33:49 -0400 Received: from inva020.nxp.com ([92.121.34.13]:49696 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729411AbfG3Kdt (ORCPT ); Tue, 30 Jul 2019 06:33:49 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id ECBD41A066C; Tue, 30 Jul 2019 12:33:47 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E07041A066B; Tue, 30 Jul 2019 12:33:47 +0200 (CEST) Received: from lorenz.ea.freescale.net (lorenz.ea.freescale.net [10.171.71.5]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 80D52204D6; Tue, 30 Jul 2019 12:33:47 +0200 (CEST) From: Iuliana Prodan To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx Subject: [PATCH v2 0/2] crypto: validate inputs for gcm and aes Date: Tue, 30 Jul 2019 13:33:42 +0300 Message-Id: <1564482824-26581-1-git-send-email-iuliana.prodan@nxp.com> X-Mailer: git-send-email 2.1.0 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Added inline helper functions to check authsize and assoclen for gcm, rfc4106 and rfc4543. Added, also, inline helper function to check key length for AES algorithms. These are used in the generic implementation of gcm/rfc4106/rfc4543 and aes. Changes since v1: - rename helper functions with crypto_ prefix; - update aes after it was moved to lib/crypto. Iuliana Prodan (2): crypto: gcm - helper functions for assoclen/authsize check crypto: aes - helper function to validate key length for AES algorithms crypto/gcm.c | 41 ++++++++++++++------------------------- include/crypto/aes.h | 17 ++++++++++++++++ include/crypto/gcm.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/crypto/aes.c | 8 ++++---- 4 files changed, 91 insertions(+), 30 deletions(-) -- 2.1.0