From patchwork Tue Feb 24 11:03:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 44932 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8A38020502 for ; Tue, 24 Feb 2015 11:03:33 +0000 (UTC) Received: by wesq59 with SMTP id q59sf16484471wes.2 for ; Tue, 24 Feb 2015 03:03:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=zncNlVOehAgsnNjmo2JjHo5FVCuxWDGmAj+t806N4BI=; b=SmwhyBXTtxvl9vglWe4bx7eGPYvUcReoLUHUtBUOMNGeDkKZp659CZJIk5+U+ATg4G nxHazEEQC7GAMo8hm1wrZz6e+8moMCglY6TZis4cSXFp9+1fDWcOSECtEyKBec50Tsu0 jDCj0fQZiQRpd0CEKnrGV0XWl4VqLDpBuSeYulSa+f2IkiFIR/393QjUVRhsLvjxi2FB 2Idr7U24ErqTiKyRn7R4B3aK8g5hC7OFPuJD0Mius+UJQfng3B1cWRzsUnCY/57yWyLN Qj0KLe7BJmXprk/LP/ZF1+YcryV9wxYhDW/gsXqH95kTuQxEctbqEqd2x/MKKmsKQPW0 JYtw== X-Gm-Message-State: ALoCoQmSib8UolVVb6Jiss+5ksEDmnRdlYiANct7PazQuBlNybVEIT5jU+M5bi1ssnRoWQ7dKQMQ X-Received: by 10.112.145.133 with SMTP id su5mr1206605lbb.17.1424775812778; Tue, 24 Feb 2015 03:03:32 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.38 with SMTP id x6ls339358lax.63.gmail; Tue, 24 Feb 2015 03:03:32 -0800 (PST) X-Received: by 10.112.24.235 with SMTP id x11mr13820598lbf.18.1424775812519; Tue, 24 Feb 2015 03:03:32 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id vn1si26241223lbb.101.2015.02.24.03.03.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 03:03:32 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by labgq15 with SMTP id gq15so25015346lab.3 for ; Tue, 24 Feb 2015 03:03:32 -0800 (PST) X-Received: by 10.152.179.172 with SMTP id dh12mr13558979lac.76.1424775812408; Tue, 24 Feb 2015 03:03:32 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1834996lbj; Tue, 24 Feb 2015 03:03:31 -0800 (PST) X-Received: by 10.140.201.8 with SMTP id w8mr24026386qha.51.1424775811224; Tue, 24 Feb 2015 03:03:31 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id n1si30532757qha.105.2015.02.24.03.03.30 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Feb 2015 03:03:31 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQDGy-0000WY-H5; Tue, 24 Feb 2015 11:03:28 +0000 Received: from mail-lb0-f180.google.com ([209.85.217.180]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQDGk-0000PI-Qe for lng-odp@lists.linaro.org; Tue, 24 Feb 2015 11:03:14 +0000 Received: by lbiz11 with SMTP id z11so24141155lbi.5 for ; Tue, 24 Feb 2015 03:03:09 -0800 (PST) X-Received: by 10.152.8.229 with SMTP id u5mr13862174laa.4.1424775789295; Tue, 24 Feb 2015 03:03:09 -0800 (PST) Received: from localhost.localdomain ([80.77.38.170]) by mx.google.com with ESMTPSA id pq1sm6180805lbb.41.2015.02.24.03.03.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Feb 2015 03:03:08 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Tue, 24 Feb 2015 13:03:02 +0200 Message-Id: <1424775782-15453-3-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424775782-15453-1-git-send-email-taras.kondratiuk@linaro.org> References: <1424775782-15453-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: crypto patch Subject: [lng-odp] [PATCHv2 2/2] linux-generic: crypto: fix crypto operation return code for invalid IV X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Current code returns an incompatible enum value as an error code in case of not specified IV. Use a proper return code instead. Signed-off-by: Taras Kondratiuk --- platform/linux-generic/odp_crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index bc0f961..9635453 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -161,7 +161,7 @@ enum crypto_alg_err des_encrypt(odp_crypto_op_params_t *params, else if (session->cipher.iv.data) iv_ptr = session->cipher.iv.data; else - return ODP_CRYPTO_SES_CREATE_ERR_INV_CIPHER; + return ODP_CRYPTO_ALG_ERR_IV_INVALID; /* * Create a copy of the IV. The DES library modifies IV @@ -199,7 +199,7 @@ enum crypto_alg_err des_decrypt(odp_crypto_op_params_t *params, else if (session->cipher.iv.data) iv_ptr = session->cipher.iv.data; else - return ODP_CRYPTO_SES_CREATE_ERR_INV_CIPHER; + return ODP_CRYPTO_ALG_ERR_IV_INVALID; /* * Create a copy of the IV. The DES library modifies IV