From patchwork Mon Jan 8 16:00:26 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: 123740 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2904101qgn; Mon, 8 Jan 2018 08:04:33 -0800 (PST) X-Google-Smtp-Source: ACJfBotyX83U4ics48WEFbUC9yYdrDTKuj3WM08fzmsF0/17c9dFuOkOUOph7qbZ7Ii8QBQ0G1tg X-Received: by 10.37.86.132 with SMTP id k126mr11483286ybb.161.1515427318603; Mon, 08 Jan 2018 08:01:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515427318; cv=none; d=google.com; s=arc-20160816; b=kAl6kiCzCp7ZxB8vK7F1euxglE/KJSYf71EEikcV2jJ7Gs2qoLCElIrn32mPCVU8xx 6d3lrH8Zr453M9U3hAQs5n06sc0szjzGv8/K3Igt9/b/clJoaBG276shfyTa53bsgRFF Zmn8wcgSpUIOcaOECn7cFz9OoQwodXDENXZU9sn0Wzaz0Sb+nzH5ikX1p8PEvivnlrCp NU5cr9Tm8c9jpz1iFG1VgXCkhPm6QN5+PmQOoTFpDrt/cFprV5mYz/VyYNLjzLdYhedd nEH7F4Rc4dCbY0gIFKi+BLbdAcsOjBHm3/hId1X7S+40s85/e51fTLtjjDyBNhJPerm4 upEg== 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=TR9vmMjLjSa/AOq10qBtiQkpO8bYo9yqLr0J+0BPGZc=; b=Fi9hTyt1gXKH524dKDyCQNH7GrDSfoaxtbEIJ0vagEgBho4gyXMM81VaFdMr1JhBu3 wCCvJO0b3I4vVztnLMpHqHucR+hDVzEa1eJekJzCPL4+yaUhuUpKKGl/TgAeZFyufu/B DPdWdiujuqBPdnKRaCOA+n/V5G168d+s2ciZVwS3kpPeEm8lzoQw0btpKH9WzEvomESw 4DqEeSFlG2tSc5Lv8Z8of5EN25HyfHbitQKS/V+FE5uhsw1QRIBd0BjZxCBig826adM0 OHg810flO2S9icUkq/ByGS0lWgh5YyP9ciLCzmjWPbgXLkRp8ibhtfYPZr+AjmaME5qk 3dBg== 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 c64si595194qka.459.2018.01.08.08.01.58; Mon, 08 Jan 2018 08:01:58 -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 273E16174E; Mon, 8 Jan 2018 16:01:58 +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, 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 17D9B61746; Mon, 8 Jan 2018 16:00:47 +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 87949616E5; Mon, 8 Jan 2018 16:00:37 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 2DAD16156D for ; Mon, 8 Jan 2018 16:00:32 +0000 (UTC) Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 9A6452182C12 for ; Mon, 8 Jan 2018 19:00:30 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback7o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4GhjAGT1BJ-0UKmD4bf; Mon, 08 Jan 2018 19:00:30 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id URiJgmKJyP-0Tn4WHfR; Mon, 08 Jan 2018 19:00:29 +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: Mon, 8 Jan 2018 19:00:26 +0300 Message-Id: <1515427227-16892-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515427227-16892-1-git-send-email-odpbot@yandex.ru> References: <1515427227-16892-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 329 Subject: [lng-odp] [PATCH API-NEXT v4 1/2] 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: 6303c7d0e98fafe0f14c8c4dd9989b3b7633ebf4 ** Merge commit sha: 7a6721af0db3111e629ae21d032335b299218009 **/ include/odp/api/spec/ipsec.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 4c3c498cd..66595b30a 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -238,6 +238,10 @@ typedef struct odp_ipsec_capability_t { */ odp_support_t retain_header; + /** Implementation will automatically truncate TFC padding in received + * packets */ + odp_bool_t tfc_padding_truncate; + /** Maximum number of different destination CoSes in classification * pipelining. The same CoS may be used for many SAs. This is equal or * less than 'max_cos' capability in classifier API. @@ -1206,6 +1210,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. For ESP + * transport mode ODP does not truncate such padding, it up to an application + * to detect and drop it. For ESP tunnel mode, received side can use total + * (IPv4) or payload (IPv6) length from internal headers to drop such TFC + * padding. If @tfc_padding_truncate capability is set, implementation will + * truncate received packets automatically. Otherwise ODP application has to + * truncate packets manually. + * * 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 +1283,11 @@ 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). It 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 *