Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5959061ybi; Wed, 31 Jul 2019 06:07:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxs5vazSsoj7tUkUGcMm5/8/0aeGizXIuzdLAcooewJnJtATQp0gWtatkSK3QeWdoZJ7KMy X-Received: by 2002:a17:902:be03:: with SMTP id r3mr121864604pls.156.1564578427188; Wed, 31 Jul 2019 06:07:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564578427; cv=none; d=google.com; s=arc-20160816; b=XXQ+TckyvgcKKbHVfjytxQi2MNnQFMypewLMVFL1W3ECIQI/maQ7LNxgZjsdmGBJ6F f5ynAYmzb9COMcloLESfXS5l93563N/oAi0nfUIOpRkfFXj9v1MkvDU2MmWA4P0OA4DX mLChLBcWB6u1oJplhSRpVt519fYD2433y8rvuRU93UmNI/0hgxmAhXXM4ZZEfdoy4W1W vXByerPSLoF7tbJ02DETfdUATDv0lnAsmTPOHBgXbzam/KF0XIwxcOBwLWAOcYWbLN/w d9tA821w3bf6vt/ZGNbJfm9qi/qiI5MGI5bEIGYqqdl1tO+kLt7BAt2V12uj6mDc5rOt 8Bjw== 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=wY9Muq+ps/Ps5xgpv/s+dCa69cKdNrqGdoDREP6zZPM=; b=Qx2u6mST1SWYYobAx53u54BZKsl9PaqmIFKKAe60gT5WqGKoeiXmN1M20Mc2OZew7l 4Yh+/GkLX7o8tY3RVL6abcYy0/pxp/hOXh+gpJz4H7m1rXM6nkqBwqi9FhjfKro0fGXH c5/zxWIMB8iGG6qyBRMCqjQpF8LvGj+5I9pgtKjxczE+Ssn6zhDruExCPTvu7PRvGmp4 P37zDChuDYxdlX86Vo05Mpbj2OSQfO03MZl4f5EOlfS0f04/Y7Yhc5785IM9gYh4x7qY ABQ/GvErEMn2KCWhB6/sLUObCELg3QYEC0+i4EGULdrS245CSV6urI6x49nktbYZWDpF HoVg== 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 k70si33430930pgd.494.2019.07.31.06.06.52; Wed, 31 Jul 2019 06:07:07 -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 S2387731AbfGaNGG (ORCPT + 99 others); Wed, 31 Jul 2019 09:06:06 -0400 Received: from inva021.nxp.com ([92.121.34.21]:41186 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387604AbfGaNGG (ORCPT ); Wed, 31 Jul 2019 09:06:06 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6432F200A0C; Wed, 31 Jul 2019 15:06:04 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 574B82009FA; Wed, 31 Jul 2019 15:06:04 +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 0D579205F3; Wed, 31 Jul 2019 15:06:04 +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 v3 0/2] crypto: validate inputs for gcm and aes Date: Wed, 31 Jul 2019 16:05:53 +0300 Message-Id: <1564578355-9639-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 v2: - rename aes helper functions without crypto_ prefix; - change include for gcm.h. 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