From patchwork Thu Jun 1 08:22:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Eremin-Solenikov X-Patchwork-Id: 100833 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp697954qge; Thu, 1 Jun 2017 01:35:43 -0700 (PDT) X-Received: by 10.55.215.153 with SMTP id t25mr336433qkt.6.1496306143840; Thu, 01 Jun 2017 01:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496306143; cv=none; d=google.com; s=arc-20160816; b=T9VTHNcsXo961eVVJHTHAntIFY2DGafrPr01cu2k09ZXLUshxA1vXT8w82lERGZTXX lLR4JJmnuGL6RwPt67QVKJFEnlT//WJ8uX4qmZh9ecwEJWm3E54ifznYg9F+UQN+aa2Z 5mVXUhq9oaL62CtSXZ2JFjFXRWUPvyhoMRh/lcA2mraN1XfUNsxLwSnA4BZ1/ZbR7aq3 2fbpTjmUILDVk6T6DDs7V00CgipqtLFm7ku6rt/qQTQRix65KefmH/J05ShytbsHuxm7 MVx03jP9jUUCgc3n5A6aQn6AxVWUv88aWxGLUcm6NgBJvuktG5YpiyXDZcRtpQ2md9Wt 21qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=N/+QgRU4B5MYbcc5NceTLzQ5Ofi/ZeqiQfjc4k3h+Ko=; b=daB84qPyM8b6YCxWynmX8kwsC47M7el/Y2BwPG6b415hqxMnboI0DnUcFsT8DGDWcd FyGuucaPAfXcN8BroOkQ/AIGBDSOz/C/WxewFJANFUKNbS8NOzuxVl4cPgX28K0q4hbk KAYKVZWbyoWIX5f7f/qUO7Don4WIlZC2OG9ZdxTRXzvVc/8W98zbTsHiesc6tQwbPtqK 83cvrS1RqzkZiOIPi2BpBSLFkm3AyffMaHoKbLsVWhFI3CwrSWVvymfSSoNBWGh36rH7 QEuiLN/mcEsSv3msZBNPr+72U75I4RokFZoP5cCkFrzPZdZWJk0yE5xeXckH7y7xOeAK D75Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c133si19034366qkg.218.2017.06.01.01.35.43; Thu, 01 Jun 2017 01:35:43 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7072F6068E; Thu, 1 Jun 2017 08:35:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 3A7A3606A0; Thu, 1 Jun 2017 08:26:10 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A283E60C42; Thu, 1 Jun 2017 08:25:56 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id 12E9060D42 for ; Thu, 1 Jun 2017 08:23:42 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id a136so7458218lfa.0 for ; Thu, 01 Jun 2017 01:23:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=N/+QgRU4B5MYbcc5NceTLzQ5Ofi/ZeqiQfjc4k3h+Ko=; b=Tj/cmEAAKuSpjgRiW0JnMkRx/s6pfJzBGUSgCA+kyxl7G5h7XXaghUeNrUOJJvg9Gg mI7kiCo6HAF9S2c5W0F9RVwxZHCcIozsR+/20csjgjW9AwJaiwG6dpcH8vLpgpprf599 aEic09pF7D9o0nKzbl2n9BlQunUOuiM99j5POEj6oKdJa43uYOFab3ZDiFnEe+hb5QN5 A1aW1+Q4Wmi+hOfKQ3gmKNMvsHpnvFyo1nKT7VynUWQ0qPvIuy+2+qi7udqGWeJtuUyH k/7KrEOKZP8+fTpFnovtA4Euymg0maRTYhd7bxNhqfIOhZ/hhIs+pb6vMYrrW+teG/Rw fPFw== X-Gm-Message-State: AODbwcA/f/Y4j8exSJpdYSQ9ILE2LBWNM6yjxDSic11wXfzV5Rrt38Ba o8hWIZJwmSpPORfL8DZjAqKB X-Received: by 10.25.20.198 with SMTP id 67mr122634lfu.78.1496305420791; Thu, 01 Jun 2017 01:23:40 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([188.162.64.12]) by smtp.gmail.com with ESMTPSA id c78sm4185837lfh.25.2017.06.01.01.23.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2017 01:23:40 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Thu, 1 Jun 2017 11:22:57 +0300 Message-Id: <20170601082320.4673-18-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170601082320.4673-1-dmitry.ereminsolenikov@linaro.org> References: <20170601082320.4673-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [PATCH API-NEXT v4 10/23] linux-generic: crypto: explicitly disable padding for AES-GCM X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Dmitry Eremin-Solenikov --- platform/linux-generic/odp_crypto.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.11.0 diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 3deec7de3f7c..ff3f1ac76780 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -291,6 +291,7 @@ odp_crypto_alg_err_t aes_gcm_encrypt(odp_crypto_op_param_t *param, EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, session->p.iv.length, NULL); EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, iv_ptr); + EVP_CIPHER_CTX_set_padding(ctx, 0); /* Authenticate header data (if any) without encrypting them */ if (aad_len > 0) @@ -338,6 +339,7 @@ odp_crypto_alg_err_t aes_gcm_decrypt(odp_crypto_op_param_t *param, EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, session->p.iv.length, NULL); EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, iv_ptr); + EVP_CIPHER_CTX_set_padding(ctx, 0); EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, session->p.auth_digest_len, tag);