From patchwork Tue Feb 27 20:00:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129854 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp216197lja; Tue, 27 Feb 2018 12:07:56 -0800 (PST) X-Google-Smtp-Source: AG47ELuKzpqO9ToGor858tgzTIV2es0Gc0CDbQtn7UukVyTcznAI6T2dtJcgUIG+Waois6ICijSk X-Received: by 10.55.217.143 with SMTP id q15mr24459169qkl.38.1519762076038; Tue, 27 Feb 2018 12:07:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519762076; cv=none; d=google.com; s=arc-20160816; b=uhL3u+MhrV+cS+OdzDbNfd3jRHm2WncRg+MGliqF31oNKrofy29a8S8mIMBEH9OK8p fSnCbOEzwxU8I5ZaUpKwx81F4fi8aiddqYp3qQdEMzMtkOSBEudo54y2JpGhPaqpEUaq wqrJOj1gKrCc+4adQsk5N/ZaIe1ty1u92rSg0iZeWiRRZ7aLq0G0Ro9M1ARw/HootB+S dYIqJwtsSSb0fMCdq3u/l9piQFIzzg7Mp1J5gWLsiC0PfU5pnFJ0I8qhOaIPsN3t8EOp 8e9480B2R/AZigxbvY8Wp/I9bYR36/dCK2ayCqaXDl5Gy1o27yOsf5tvBaUZ4rJVnemT entg== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=K8mLsNwQO8+iIqmUrz60XFRS5hf0Ud8ZZx2yiG+XOc4=; b=ck5P+f8ZXEXytbYZi4fuR1ecu9zWZjimnji/A34b4d8Uty3Vxenb32lpw6cPnC06TX dFKuLKmmAYTpKHEmGbcg7WIwmMs/eAugzPY8P5melhcQLLKf1xFbvu8YqnzZ176x8lYX kzukrREjE8nHKw6E949ACzISKrUdpDGf/xsbC9IRsPusBwub5gZpwMOf000748Ip3BH7 1V29CPGH5wFm+vSdzLOE8eFQKbULB2NTIUZsvxPHuxg1usQcilRPOHg/lKeDQS2VbKpg or111cCDD02oveJy3Qmf2xFq8XtkVezwdZwyJNBpJoG5Izhq/hat2pFLs4hXDf/rutQR TP5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id y36si1551447qtj.99.2018.02.27.12.07.55; Tue, 27 Feb 2018 12:07:56 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id B362A616E1; Tue, 27 Feb 2018 20:07:55 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 9154D61773; Tue, 27 Feb 2018 20:01:28 +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 D34DF6174B; Tue, 27 Feb 2018 20:01:06 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id DA9EF6173E for ; Tue, 27 Feb 2018 20:00:21 +0000 (UTC) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward103p.mail.yandex.net (Yandex) with ESMTP id C96572183236 for ; Tue, 27 Feb 2018 23:00:20 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id jfVogqi8gv-0KOST60p; Tue, 27 Feb 2018 23:00:20 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Upcczghx1N-0KQu3oGg; Tue, 27 Feb 2018 23:00:20 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 27 Feb 2018 23:00:09 +0300 Message-Id: <1519761609-20848-12-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519761609-20848-1-git-send-email-odpbot@yandex.ru> References: <1519761609-20848-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 502 Subject: [lng-odp] [PATCH API-NEXT v3 11/11] validation: ipsec: inbound TFC dummy packets check 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" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 502 (lumag:ipsec-imp-upd) ** https://github.com/Linaro/odp/pull/502 ** Patch: https://github.com/Linaro/odp/pull/502.patch ** Base sha: ce5c4f9e7ce9fe504451c29429b9ae9fb68083ae ** Merge commit sha: fcd6960c97fe9a0a399be4f3418ba3dd83134544 **/ test/validation/api/ipsec/ipsec_test_in.c | 43 ++++++++++++++++++++++++++++--- test/validation/api/ipsec/test_vectors.h | 19 +++++++++++++- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/test/validation/api/ipsec/ipsec_test_in.c b/test/validation/api/ipsec/ipsec_test_in.c index d02cb2438..9c1112004 100644 --- a/test/validation/api/ipsec/ipsec_test_in.c +++ b/test/validation/api/ipsec/ipsec_test_in.c @@ -1131,13 +1131,17 @@ static void test_in_ipv4_mcgrew_gcm_4_esp(void) ipsec_sa_destroy(sa); } -#if 0 static void test_in_ipv4_mcgrew_gcm_12_esp(void) { odp_ipsec_tunnel_param_t tunnel = {}; odp_ipsec_sa_param_t param; odp_ipsec_sa_t sa; + /* This test will not work properly inbound inline mode. + * Packet might be dropped and we will not check for that. */ + if (suite_context.inbound_op_mode == ODP_IPSEC_OP_MODE_INLINE) + return; + ipsec_sa_param_fill(¶m, true, false, 0x335467ae, &tunnel, ODP_CIPHER_ALG_AES_GCM, &key_mcgrew_gcm_12, @@ -1164,7 +1168,38 @@ static void test_in_ipv4_mcgrew_gcm_12_esp(void) ipsec_sa_destroy(sa); } -#endif + +static void test_in_ipv4_mcgrew_gcm_12_esp_notun(void) +{ + odp_ipsec_sa_param_t param; + odp_ipsec_sa_t sa; + + ipsec_sa_param_fill(¶m, + true, false, 0x335467ae, NULL, + ODP_CIPHER_ALG_AES_GCM, &key_mcgrew_gcm_12, + ODP_AUTH_ALG_AES_GCM, NULL, + &key_mcgrew_gcm_salt_12); + + sa = odp_ipsec_sa_create(¶m); + + CU_ASSERT_NOT_EQUAL_FATAL(ODP_IPSEC_SA_INVALID, sa); + + ipsec_test_part test = { + .pkt_in = &pkt_mcgrew_gcm_test_12_esp, + .out_pkt = 1, + .out = { + { .status.warn.all = 0, + .status.error.all = 0, + .l3_type = ODP_PROTO_L3_TYPE_IPV4, + .l4_type = ODP_PROTO_L4_TYPE_NO_NEXT, + .pkt_out = &pkt_mcgrew_gcm_test_12_notun }, + }, + }; + + ipsec_check_in_one(&test, sa); + + ipsec_sa_destroy(sa); +} static void test_in_ipv4_mcgrew_gcm_15_esp(void) { @@ -1584,10 +1619,10 @@ odp_testinfo_t ipsec_in_suite[] = { ipsec_check_esp_aes_gcm_256), ODP_TEST_INFO_CONDITIONAL(test_in_ipv4_mcgrew_gcm_4_esp, ipsec_check_esp_aes_gcm_128), -#if 0 ODP_TEST_INFO_CONDITIONAL(test_in_ipv4_mcgrew_gcm_12_esp, ipsec_check_esp_aes_gcm_128), -#endif + ODP_TEST_INFO_CONDITIONAL(test_in_ipv4_mcgrew_gcm_12_esp_notun, + ipsec_check_esp_aes_gcm_128), ODP_TEST_INFO_CONDITIONAL(test_in_ipv4_mcgrew_gcm_15_esp, ipsec_check_esp_null_aes_gmac_128), ODP_TEST_INFO_CONDITIONAL(test_in_ipv4_rfc7634_chacha, diff --git a/test/validation/api/ipsec/test_vectors.h b/test/validation/api/ipsec/test_vectors.h index f14fdb2b3..4d5ab3bdc 100644 --- a/test/validation/api/ipsec/test_vectors.h +++ b/test/validation/api/ipsec/test_vectors.h @@ -1641,7 +1641,7 @@ static const ipsec_test_packet pkt_mcgrew_gcm_test_4_esp = { static const ipsec_test_packet pkt_mcgrew_gcm_test_12 = { .len = 14, .l2_offset = 0, - .l3_offset = ODP_PACKET_OFFSET_INVALID, + .l3_offset = 14, .l4_offset = ODP_PACKET_OFFSET_INVALID, .data = { /* ETH - not a part of RFC, added for simplicity */ @@ -1650,6 +1650,23 @@ static const ipsec_test_packet pkt_mcgrew_gcm_test_12 = { }, }; +static const ipsec_test_packet pkt_mcgrew_gcm_test_12_notun = { + .len = 34, + .l2_offset = 0, + .l3_offset = 14, + .l4_offset = 34, + .data = { + /* ETH - not a part of RFC, added for simplicity */ + 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, + 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0x08, 0x00, + + /* IP - not a part of RFC, added for simplicity */ + 0x45, 0x00, 0x00, 0x14, 0x69, 0x8f, 0x00, 0x00, + 0x80, 0x3b, 0x4d, 0xcc, 0xc0, 0xa8, 0x01, 0x02, + 0xc0, 0xa8, 0x01, 0x01, + }, +}; + static const ipsec_test_packet pkt_mcgrew_gcm_test_12_esp = { .len = 70, .l2_offset = 0,