From patchwork Mon Jul 24 15:00:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 108589 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp3963433obm; Mon, 24 Jul 2017 08:15:13 -0700 (PDT) X-Received: by 10.55.106.67 with SMTP id f64mr5284616qkc.15.1500909313282; Mon, 24 Jul 2017 08:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500909313; cv=none; d=google.com; s=arc-20160816; b=YPTtlNIhd4KdKaOTrzGJ5bCh22RGa9uyzI3jm5DhpezhK4lYtehpuy6ky9enF6Zza1 P37N2frpsx4QohTPyvxzaI+12Nce4TJ0ZWHOoteuS/oWhehy8KyyognnoWI9IzXxs1fL DD51p+FlOANuNWbuwHEqJCnrrT3M4Vg+XQvZ6pm5YT3PegVeT2SdGp2j+lbrUKffRCNw 6N1LZjZtJpUca1qKP3abz0uCAnDAv8yCUi9YFv8d7sdc+InNArXeqbvHdFDiVMf3sZ2i C9wYRnzz3lB75Zr8sfirT+S2Gw3Nn7Rt9m0MpWyKU8Ktoc6ExIW0g3xXnqwScG+IiFeM hHsA== 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=9lMi2IVp1A4hcjv287gI2z7NAzaUgPQn/qvvc+uoKzI=; b=yybNKTg8D5QlHFcI0JBc51lGSeKqmo5ekMANcjU5DQOSnLLOBr+QFqXjLMh7l/SJhc jIHYCFWUyaO18gZM5ggEV1s4xDa6HpTRyOQUPfLaES/TF7eYVYAYdfSP/SdvIcWI13Yo 2oZ1IV0o3V022sCPXzkK3PLHxi17ovCFC7tA/vDUfu3KwRHiBcK/quEwbhRHQLkbpotD IDjQmOJ4yIW9Ne3+sNccdz2dDOr8KeX0uCBtnqB+zHDZP70EJM6WC+v/1oo/ntR6x6s7 GXNOoqjS32V7Ak0wt+n8VCQIEXGu7NM54s3cBJvkkGR2QB013cWSKlbD44k1vNBzdSyE kvWA== 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j1si8943225qkc.320.2017.07.24.08.15.12; Mon, 24 Jul 2017 08:15:13 -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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id B774D644B1; Mon, 24 Jul 2017 15:15:12 +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,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 D7F0C644BB; Mon, 24 Jul 2017 15:04:17 +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 675F464490; Mon, 24 Jul 2017 15:03:49 +0000 (UTC) Received: from forward4o.cmail.yandex.net (forward4o.cmail.yandex.net [37.9.109.248]) by lists.linaro.org (Postfix) with ESMTPS id 2FE2662ECD for ; Mon, 24 Jul 2017 15:03:06 +0000 (UTC) Received: from smtp1m.mail.yandex.net (smtp1m.mail.yandex.net [77.88.61.132]) by forward4o.cmail.yandex.net (Yandex) with ESMTP id A665E20D84 for ; Mon, 24 Jul 2017 18:03:04 +0300 (MSK) Received: from smtp1m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1m.mail.yandex.net (Yandex) with ESMTP id 38BF163C0AEA for ; Mon, 24 Jul 2017 18:03:03 +0300 (MSK) Received: by smtp1m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id j48yURuil2-2tqauPpn; Mon, 24 Jul 2017 18:02:57 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 24 Jul 2017 18:00:44 +0300 Message-Id: <1500908444-7531-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500908444-7531-1-git-send-email-odpbot@yandex.ru> References: <1500908444-7531-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v5 9/9] fixup! test: validation: add IPsec API testsuite 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 81 (lumag:ipsec-packet-impl-2) ** https://github.com/Linaro/odp/pull/81 ** Patch: https://github.com/Linaro/odp/pull/81.patch ** Base sha: db7cc41aeb559dd296f3a6d8570aa10326a31d5e ** Merge commit sha: ba0b39db1fc90b24a3db1e85e00c2c485b235a47 **/ test/common_plat/validation/api/ipsec/ipsec.c | 2 ++ .../validation/api/ipsec/test_vectors.h | 24 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/test/common_plat/validation/api/ipsec/ipsec.c b/test/common_plat/validation/api/ipsec/ipsec.c index 910901d6..361869ea 100644 --- a/test/common_plat/validation/api/ipsec/ipsec.c +++ b/test/common_plat/validation/api/ipsec/ipsec.c @@ -354,9 +354,11 @@ odp_bool_t ipsec_check_packet(const ipsec_test_packet *itp, odp_packet_t pkt) l4 = odp_packet_l4_offset(pkt); odp_packet_copy_to_mem(pkt, 0, len, data); + CU_ASSERT_EQUAL(len - l3, itp->len - itp->l3_offset); if (len - l3 != itp->len - itp->l3_offset) return false; + CU_ASSERT_EQUAL(l4 - l3, itp->l4_offset - itp->l3_offset); if (l4 - l3 != itp->l4_offset - itp->l3_offset) return false; diff --git a/test/common_plat/validation/api/ipsec/test_vectors.h b/test/common_plat/validation/api/ipsec/test_vectors.h index facd0636..623949d0 100644 --- a/test/common_plat/validation/api/ipsec/test_vectors.h +++ b/test/common_plat/validation/api/ipsec/test_vectors.h @@ -31,6 +31,8 @@ KEY(key_rfc3602, 0x90, 0xd3, 0x82, 0xb4, 0x10, 0xee, 0xba, 0x7a, 0xd9, 0x38, 0xc4, 0x6c, 0xec, 0x1a, 0x82, 0xbf); KEY(key_rfc3602_2, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef); +KEY(key_mcgrew_gcm_test_1, 0x4c, 0x80, 0xcd, 0xef, 0xbb, 0x5d, 0x10, 0xda, + 0x90, 0x6a, 0xc7, 0x3c, 0x36, 0x13, 0xa6, 0x34); static const ODP_UNUSED ipsec_test_packet pkt_icmp_0 = { .len = 142, @@ -725,4 +727,26 @@ static const ipsec_test_packet pkt_rfc3602_8_esp = { }, }; +static const ipsec_test_packet pkt_mcgrew_gcm_test_1 = { + .len = 72, + .l2_offset = ODP_PACKET_OFFSET_INVALID, + .l3_offset = 0, + .l4_offset = 20, + .data = { + /* IP */ + 0x45, 0x00, 0x00, 0x48, 0x69, 0x9a, 0x00, 0x00, + 0x80, 0x11, 0x4d, 0xb7, 0xc0, 0xa8, 0x01, 0x02, + 0xc0, 0xa8, 0x01, 0x01, + + /* UDP */ + 0x0a, 0x9b, 0xf1, 0x56, 0x38, 0xd3, 0x01, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x5f, 0x73, 0x69, 0x70, 0x04, 0x5f, 0x75, + 0x64, 0x70, 0x03, 0x73, 0x69, 0x70, 0x09, 0x63, + 0x79, 0x62, 0x65, 0x72, 0x63, 0x69, 0x74, 0x79, + 0x02, 0x64, 0x6b, 0x00, 0x00, 0x21, 0x00, 0x01, + 0x01, 0x02, 0x02, 0x01, + }, +}; + #endif