From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 979C5A0518 for ; Fri, 24 Jul 2020 14:10:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8EF761C21A; Fri, 24 Jul 2020 14:10:18 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 064C41C216 for ; Fri, 24 Jul 2020 14:10:17 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id y3so8091368wrl.4 for ; Fri, 24 Jul 2020 05:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Sgo7HMrsUaDMoo7WAnDLT64d0qEdxSys7Aa1LV0iTC4=; b=m9+kAdFoxWVGBSsgA9i7y5iSe1ZFc2HbFwCo17ckDm8vEYHkA+8x7H+mGnTtH1ro3u HlYys8RIeXyZqAVKKONPxS0P5BdmflVz8MqI8nLPHv+R/XPItYd+hqZIrW7k9VwFVK4m 6r0W/bcNoblhjoIU/Wu5SJjtO2nPVxUgResKDOd7j+FVHgdUlI15YkiNKnZ3kmsHkfTr 5Pg0wJPlUErt/PmNRG/7hLFmfQV2pcghYp/ipy0P4b+5+vraKmzcfRV6SAo5SUtS5/gg b6ZhuAOpsUdpWBFFGcvZhMW4SZYS4LNPTtIJTzNISXhO+1irVdCwcn5kFh9MbK1d6A0P XXog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Sgo7HMrsUaDMoo7WAnDLT64d0qEdxSys7Aa1LV0iTC4=; b=OJswVu05nIeWF9y50Z2W9mSkNKIne8P4nYwtK4nanWVaZi+xG9eNtX2ysgGTwviVza kQwtRZ4azEsRRZ9PtvCpUFivSpTsAx6Xw5LpdhoeEWiWjDykF6xSCTdXe+D/5BzYkOCP KjO7CkRQrntoecN7Ek2x4oDD+PfN1Qvb/ubDUzuiNFw0CSCh6lJmfs2kWFUHdRuaYoZY Az2j087q566KM660LFUxUimSEn2sGsVceYRFqF1eYam3ICw42SPPC96JTTW8bmLhDChT OsDqJAb8eRCOSOk4+Gkarhxs84eJQLt+smF9zCiUOOHmkHNuBk3HjLNHmF7oRrCx8S/p FlCw== X-Gm-Message-State: AOAM532eWSSjNV69R2PGwlVUe5IFzWCOODemEsKYnShK3b2Oa1ij8SjN J2gYgXvkMOIcUYhJPIpFe2g= X-Google-Smtp-Source: ABdhPJzqIe+n9Pfi5vQCz21BjhQZarKfj0jIP9dFTMX08JVjXH+rFOZCWu77waYvA3GTjetCyBqadA== X-Received: by 2002:adf:ce89:: with SMTP id r9mr5881450wrn.116.1595592616695; Fri, 24 Jul 2020 05:10:16 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id s203sm7225102wms.32.2020.07.24.05.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:10:16 -0700 (PDT) From: luca.boccassi@gmail.com To: Ayuj Verma Cc: Archana Muniganti , dpdk stable Date: Fri, 24 Jul 2020 12:59:48 +0100 Message-Id: <20200724120030.1863487-150-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'examples/fips_validation: fix parsing of TDES vectors' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 215e6ceee6a33978b52b1a4d5cf1c4bd12d3389f Mon Sep 17 00:00:00 2001 From: Ayuj Verma Date: Thu, 11 Jun 2020 19:14:16 +0530 Subject: [PATCH] examples/fips_validation: fix parsing of TDES vectors [ upstream commit 32440cdf2af9ad38fd32a533f51a32da92345007 ] Processing of test vector for COUNT = 0 is getting skipped, as some of the NIST TDES files doesn't have an empty line after [ENCRYPT]/[DECRYPT] and thus treated as an interim block. Parse function now identifies such blocks, separates out interim and test vector data, and then parses each with their respective callbacks. Fixes: 3d0fad56b74a ("examples/fips_validation: add crypto FIPS application") Signed-off-by: Archana Muniganti Signed-off-by: Ayuj Verma --- examples/fips_validation/fips_validation.c | 21 +++++++++++++++------ examples/fips_validation/fips_validation.h | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c index b79a095ac..bffc682de 100644 --- a/examples/fips_validation/fips_validation.c +++ b/examples/fips_validation/fips_validation.c @@ -334,11 +334,13 @@ int fips_test_parse_one_case(void) { uint32_t i, j = 0; - uint32_t is_interim = 0; + uint32_t is_interim; + uint32_t interim_cnt = 0; int ret; if (info.interim_callbacks) { for (i = 0; i < info.nb_vec_lines; i++) { + is_interim = 0; for (j = 0; info.interim_callbacks[j].key != NULL; j++) if (strstr(info.vec[i], info.interim_callbacks[j].key)) { @@ -351,17 +353,24 @@ fips_test_parse_one_case(void) if (ret < 0) return ret; } + + if (is_interim) + interim_cnt += 1; } } - if (is_interim) { - for (i = 0; i < info.nb_vec_lines; i++) + info.vec_start_off = interim_cnt; + + if (interim_cnt) { + for (i = 0; i < interim_cnt; i++) fprintf(info.fp_wr, "%s\n", info.vec[i]); fprintf(info.fp_wr, "\n"); - return 1; + + if (info.nb_vec_lines == interim_cnt) + return 1; } - for (i = 0; i < info.nb_vec_lines; i++) { + for (i = info.vec_start_off; i < info.nb_vec_lines; i++) { for (j = 0; info.callbacks[j].key != NULL; j++) if (strstr(info.vec[i], info.callbacks[j].key)) { ret = info.callbacks[j].cb( @@ -381,7 +390,7 @@ fips_test_write_one_case(void) { uint32_t i; - for (i = 0; i < info.nb_vec_lines; i++) + for (i = info.vec_start_off; i < info.nb_vec_lines; i++) fprintf(info.fp_wr, "%s\n", info.vec[i]); } diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h index d487fb005..d51736529 100644 --- a/examples/fips_validation/fips_validation.h +++ b/examples/fips_validation/fips_validation.h @@ -160,6 +160,7 @@ struct fips_test_interim_info { enum fips_test_algorithms algo; char *one_line_text; char *vec[MAX_LINE_PER_VECTOR]; + uint32_t vec_start_off; uint32_t nb_vec_lines; char device_name[MAX_STRING_SIZE]; char file_name[MAX_STRING_SIZE]; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:54.360281944 +0100 +++ 0150-examples-fips_validation-fix-parsing-of-TDES-vectors.patch 2020-07-24 12:53:48.511010633 +0100 @@ -1,8 +1,10 @@ -From 32440cdf2af9ad38fd32a533f51a32da92345007 Mon Sep 17 00:00:00 2001 +From 215e6ceee6a33978b52b1a4d5cf1c4bd12d3389f Mon Sep 17 00:00:00 2001 From: Ayuj Verma Date: Thu, 11 Jun 2020 19:14:16 +0530 Subject: [PATCH] examples/fips_validation: fix parsing of TDES vectors +[ upstream commit 32440cdf2af9ad38fd32a533f51a32da92345007 ] + Processing of test vector for COUNT = 0 is getting skipped, as some of the NIST TDES files doesn't have an empty line after [ENCRYPT]/[DECRYPT] and thus treated as an interim block. @@ -12,7 +14,6 @@ callbacks. Fixes: 3d0fad56b74a ("examples/fips_validation: add crypto FIPS application") -Cc: stable@dpdk.org Signed-off-by: Archana Muniganti Signed-off-by: Ayuj Verma @@ -22,10 +23,10 @@ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c -index a34e34d25..3aaec20fb 100644 +index b79a095ac..bffc682de 100644 --- a/examples/fips_validation/fips_validation.c +++ b/examples/fips_validation/fips_validation.c -@@ -340,11 +340,13 @@ int +@@ -334,11 +334,13 @@ int fips_test_parse_one_case(void) { uint32_t i, j = 0; @@ -40,7 +41,7 @@ for (j = 0; info.interim_callbacks[j].key != NULL; j++) if (strstr(info.vec[i], info.interim_callbacks[j].key)) { -@@ -357,17 +359,24 @@ fips_test_parse_one_case(void) +@@ -351,17 +353,24 @@ fips_test_parse_one_case(void) if (ret < 0) return ret; } @@ -69,7 +70,7 @@ for (j = 0; info.callbacks[j].key != NULL; j++) if (strstr(info.vec[i], info.callbacks[j].key)) { ret = info.callbacks[j].cb( -@@ -387,7 +396,7 @@ fips_test_write_one_case(void) +@@ -381,7 +390,7 @@ fips_test_write_one_case(void) { uint32_t i; @@ -79,10 +80,10 @@ } diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h -index 5aee955c1..75fa555fa 100644 +index d487fb005..d51736529 100644 --- a/examples/fips_validation/fips_validation.h +++ b/examples/fips_validation/fips_validation.h -@@ -161,6 +161,7 @@ struct fips_test_interim_info { +@@ -160,6 +160,7 @@ struct fips_test_interim_info { enum fips_test_algorithms algo; char *one_line_text; char *vec[MAX_LINE_PER_VECTOR];