From patchwork Thu Jun 1 09:03:26 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: 100847 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp708389qge; Thu, 1 Jun 2017 02:11:28 -0700 (PDT) X-Received: by 10.237.55.193 with SMTP id j59mr468600qtb.238.1496308287952; Thu, 01 Jun 2017 02:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496308287; cv=none; d=google.com; s=arc-20160816; b=OyJKuPVvw6m8CQ31jQ7Qq5NX2HWgksEcGvvDWnF8KB1j5XI6TwpdYVMrEBpO4reNyT RV3VjN0teRzDf8k4Vq+KMaU2YuOh2JKbjILXiwNf1LPNej9CMU5W1iMPig7FTtFtyOOs Yz9uZ+cTkkWXFr1icqrPOqqJNGkh/1IqyO70ECipb5St5jcZH4Ij4IdFR7+1j0mdUj3T kTKRVvu0ynyJvPtdNSLgPLa7YEYZ5J3ma6CPFAIAi5wkF1+m3GXVkkSmBTHZPstmx6T4 n0CGjoSXH/GN4oj5FXs1y98nT3zqDWWnDVq00QsZ3bCi6dk89+NPYu6KJ+/LZjhl2K44 xGnQ== 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=gXLyeL7PTLJE6Sb7NQUpKZLqqxt/IY9fzo81YH9/PfVp9ZmA2ADS63algW66GaoaKq F9Pf1sAzYWvXHnslKbXm28sXOodbVyKLFVtD7HfbP9AZdYSQ5hBlcbkCNMhoMCE48F0A 3bok87CuqQ2fawpJ0JGOBFUio1qP7yyiEXNNnDocz+NHfnUw9TxcwokhOgz+N3Sugq65 H+zmVTd6sP4cqaUXdydhJAs1X/APfQYMfREexHzJezF8OKjxq/HTJNKJmEOtp1gbSXEp 9nBXPaZ3Kcotwnjg2YwDP3z+c6mRrCXZSdyluNNZRX4PTr1CZOxRsBq2OQLspjIwSNgI 6P+w== 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 f129si19034585qkd.136.2017.06.01.02.11.27; Thu, 01 Jun 2017 02:11:27 -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 90A0F6068C; Thu, 1 Jun 2017 09:11:27 +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 0D6F960D72; Thu, 1 Jun 2017 09:05:21 +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 A063C60972; Thu, 1 Jun 2017 09:05:16 +0000 (UTC) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) by lists.linaro.org (Postfix) with ESMTPS id 0BC6160A0F for ; Thu, 1 Jun 2017 09:03:55 +0000 (UTC) Received: by mail-lf0-f51.google.com with SMTP id a136so8034493lfa.0 for ; Thu, 01 Jun 2017 02:03:54 -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=bjIFaNY9asx7fMmTWHQbxhwjge6HXIZ5vIEQTafE/6fmu8u1elOpIsoDYx0QZQKcEg MHhU7fMvtS3E0LJTeBwNl1D6qhz+OswFZtF3i85aXaWnwbeevB7LPLCiVQrIuFNqeVE1 +iobamNkJCOacTxMpLu/0gTbc9h90pHKYxdvr6JjBnnBGu2vYXT/jBeEKJsVI1hiyV1n pqqKJZIrT3Ui5mg5kLQEibe9nJ89z4nn1av03Bew5C7B5/wuGuejdLbRvzDHmu8zfBmx gQs+U2bHoaiCf/OVdw4Gem+yAXdH11E9mg/qGrKmINnpHcVC4gZgImZ4ZQhG7Cy1jo+v aKHA== X-Gm-Message-State: AODbwcBJX8MIb0QolcdMTeoxfIksqXkJwwPnNI9M65j8iWD7BNTi2VYI ItSvdZtqZwVL/AmZgwxJISq7 X-Received: by 10.46.8.66 with SMTP id g2mr178835ljd.15.1496307833648; Thu, 01 Jun 2017 02:03:53 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([188.162.64.12]) by smtp.gmail.com with ESMTPSA id 129sm4232819ljf.36.2017.06.01.02.03.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2017 02:03:53 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Thu, 1 Jun 2017 12:03:26 +0300 Message-Id: <20170601090339.9313-11-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170601090339.9313-1-dmitry.ereminsolenikov@linaro.org> References: <20170601090339.9313-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [PATCH API-NEXT v5 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);