From patchwork Mon Aug 26 09:41:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Shamis X-Patchwork-Id: 57887 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CFEF81BFAC; Mon, 26 Aug 2019 11:24:00 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id E65FD1BFA8 for ; Mon, 26 Aug 2019 11:23:59 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7Q9KIMx021040; Mon, 26 Aug 2019 02:23:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=sl5WsccOCivwUL9PHl8bBqa05erQs71vRLD8waYbpfc=; b=ty+w0jhmzuUy/C2ohHG55rG5fqLO/hQrK1OkpiJFGPOYDnc67WsXRhsMoiTdgrv0GWaq r/f5cbSOPae128/KgT6l+x7Q2r0Aj5oFKuYICGcRMCSkNXeVd9A758esMNoqptklYTFN xq39vYoJngyfDyK5W0ga0bmdQugzBjQOruma0QzDjO4qv7keS1KFz7Rb753Cvh63vQvi G2Y1qAmUqp1+gQdXF6LQ9XoCmHHKrhpnVJbmXvKenww4Ib3+o+EEZxfgCPZzvo2W4hga 0uvjO6LPDZHNw3WtB9cT27vjXF8LUvHjN50IpedDSpwYszhQpjMAB12jZEXhCzsJONeA 6w== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2uk4rke1hp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 26 Aug 2019 02:23:59 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 26 Aug 2019 02:23:57 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 26 Aug 2019 02:23:57 -0700 Received: from vvenus375.il.marvell.com (unknown [10.5.120.75]) by maili.marvell.com (Postfix) with ESMTP id 92B9D3F7054; Mon, 26 Aug 2019 02:23:55 -0700 (PDT) From: To: CC: , , Date: Mon, 26 Aug 2019 12:41:12 +0300 Message-ID: <20190826094120.22590-5-michaelsh@marvell.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190826094120.22590-1-michaelsh@marvell.com> References: <20190826094120.22590-1-michaelsh@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-26_06:2019-08-23,2019-08-26 signatures=0 Subject: [dpdk-dev] [PATCH 04/12] examples/fips: fix bad return code in fips_test_parse_header() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Michael Shamis Returning correct error value by fips_test_parse_header() allows graceful exit of fips application. Signed-off-by: Michael Shamis --- examples/fips_validation/fips_validation.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c index fe3bcc386..91e6d48e7 100644 --- a/examples/fips_validation/fips_validation.c +++ b/examples/fips_validation/fips_validation.c @@ -125,13 +125,13 @@ fips_test_parse_header(void) info.algo = FIPS_TEST_ALGO_AES_CMAC; ret = parse_test_cmac_init(); if (ret < 0) - return 0; + return ret; } else if (strstr(info.vec[i], "CCM")) { algo_parsed = 1; info.algo = FIPS_TEST_ALGO_AES_CCM; ret = parse_test_ccm_init(); if (ret < 0) - return 0; + return ret; } else if (strstr(info.vec[i], "HMAC")) { algo_parsed = 1; info.algo = FIPS_TEST_ALGO_HMAC; @@ -143,7 +143,7 @@ fips_test_parse_header(void) info.algo = FIPS_TEST_ALGO_TDES; ret = parse_test_tdes_init(); if (ret < 0) - return 0; + return ret; } else if (strstr(info.vec[i], "SHA-")) { if (info.algo != FIPS_TEST_ALGO_HMAC) { algo_parsed = 1;