From patchwork Tue Jan 16 18:00:25 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: 124756 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1098800lje; Tue, 16 Jan 2018 10:03:11 -0800 (PST) X-Google-Smtp-Source: ACJfBouxO+54X75uR2SVfhRu21vdkWiCL8GlLUrBaLsCTaSE17fB6HTodLSi+h05ViTTWOX3g2Lu X-Received: by 10.55.125.195 with SMTP id y186mr53282055qkc.149.1516125791065; Tue, 16 Jan 2018 10:03:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516125791; cv=none; d=google.com; s=arc-20160816; b=Wthm50unjyPcHGiWq1awC45nI+vhxf61yqM4RhBhBN/3vF5d+K+vkW9F2VHELFej5g hSlx6dsOzdXLjj0i92y0Jl3geg4aLWebbYjt2Pl4GAiCbN/7o+v7I21kAnlcGQqMCfYu CVBHlGDB387OEASgjsn8+MzYyzi9kCo8ovL5NfSRJz1HAM/0mzfgSy2xyXTE3blri/u0 nGCEISI3NQHHudTy8iCdM4gA+UAJ4rHWYj6F2AEmUGu3kFQhmevp/13nk3pkI45N5FtC WkbxWhQircmNtZu1E0TP62EQRvcXMKC9rpwFGxb1Lgm9Gpi5xXUtMNiCEqznyJY03WTD BDqw== 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=d4bgP53wPJQO651fMC8mAS69N+T6FG6YGDakKKgmgCM=; b=ttRi4GrZMi/uSInIRvAz8vlpBhugU5oWlRjuZ6GG+Ej+T8tJz/yeHiDtF1TPEZmhQf R6H6hlt/pYNOpx8iBvyHD+imnY8l8h1l+tQqHlYnUIlBa/37S3XgRfp812cmATMPKArl Og81+0jJQ6+1pQur1GxR6d020Vt0sGYDTvqaPVXtK5GYTMOSLtYjyaRkT6g9Yi+3UL4/ jwEI7RBEYGv+TACbPIcxDm36RnXb1w4mAIHEOuQk4Vuhcd9VsRK2B9NKbtEc6rG3hUpQ pJi6PcAGqr09Ju2Q1e5U933siVfSHvDiMHPJym7WDa1D1dFTuQP6EORyuI+nVqCNK52/ VCjg== 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 m1si2638406qkc.406.2018.01.16.10.03.10; Tue, 16 Jan 2018 10:03:11 -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 A5C88617AC; Tue, 16 Jan 2018 18:03:10 +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_H3, RCVD_IN_MSPIKE_WL 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 53CFF6178F; Tue, 16 Jan 2018 18:01:55 +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 493A1617C9; Tue, 16 Jan 2018 18:01:49 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 93EDB6177E for ; Tue, 16 Jan 2018 18:00:30 +0000 (UTC) Received: from mxback9j.mail.yandex.net (mxback9j.mail.yandex.net [IPv6:2a02:6b8:0:1619::112]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 5050B1804144 for ; Tue, 16 Jan 2018 21:00:29 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback9j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id PT3UoPXLsz-0TYmIuMc; Tue, 16 Jan 2018 21:00:29 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ZVsbBwJW64-0S6S3SYL; Tue, 16 Jan 2018 21:00:28 +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, 16 Jan 2018 21:00:25 +0300 Message-Id: <1516125627-32748-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516125627-32748-1-git-send-email-odpbot@yandex.ru> References: <1516125627-32748-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 329 Subject: [lng-odp] [PATCH API-NEXT v8 1/3] api: ipsec: document TFC padding usage 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 It is possible to include TFC padding into ESP packets. Document usage of such padding according to RFC. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 329 (lumag:ipsec-tfc) ** https://github.com/Linaro/odp/pull/329 ** Patch: https://github.com/Linaro/odp/pull/329.patch ** Base sha: 0c7741d067d9b96e14e420b53a256a1b93096e16 ** Merge commit sha: d31d322b1d7ec8d2b9fc3694df5dd0843b52de1c **/ include/odp/api/spec/ipsec.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 4c3c498cd..738dd65ae 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -1206,6 +1206,14 @@ typedef struct odp_ipsec_status_t { * restored. The amount and content of packet data before the IP header is * undefined. * + * Additional TFC padding might be present after packet contents unless IKEv2 + * ESP_TFC_PADDING_NOT_SUPPORTED notification was used. The resulting ODP + * packet will extend beyond the end of the IP packet it contains or the + * resulting IP packet will extend beyond the end of the IP payload protocol + * (for tunnel or transport cases respectively). An ODP application can detect + * and remove such padding by inspecting the length fields of the relevant + * protocol headers in the result packet. + * * Each successfully transformed packet has a valid value for these metadata * regardless of the inner packet parse configuration * (odp_ipsec_inbound_config_t): @@ -1271,6 +1279,12 @@ int odp_ipsec_in(const odp_packet_t pkt_in[], int num_in, * with IPSEC, etc headers constructed according to the standards. The amount * and content of packet data before the IP header is undefined. * + * Additional TFC padding might be present after packet payload (see RFC 4303 + * section 2.7 for the list of requirements) unless + * ESP_TFC_PADDING_NOT_SUPPORTED notification was used. Such padding should be + * filled by application before submitting packet to ODP. Such padding will be + * included into encrypted packet. Receiver side will skip this padding. + * * Each successfully transformed packet has a valid value for these metadata: * - L3 offset: Offset to the first byte of the (outmost) IP header *