From patchwork Thu Feb 23 14:14:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 94381 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp231056qgi; Thu, 23 Feb 2017 06:16:08 -0800 (PST) X-Received: by 10.107.15.196 with SMTP id 65mr29412537iop.141.1487859368027; Thu, 23 Feb 2017 06:16:08 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i203si4817510ioa.209.2017.02.23.06.16.07; Thu, 23 Feb 2017 06:16:08 -0800 (PST) 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 79B51607A7; Thu, 23 Feb 2017 14:16:07 +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=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 1135A60F53; Thu, 23 Feb 2017 14:15:29 +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 CD2E460EAA; Thu, 23 Feb 2017 14:15:23 +0000 (UTC) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0139.outbound.protection.outlook.com [104.47.1.139]) by lists.linaro.org (Postfix) with ESMTPS id F378C60937 for ; Thu, 23 Feb 2017 14:14:54 +0000 (UTC) Received: from VI1PR0701CA0038.eurprd07.prod.outlook.com (10.173.77.24) by HE1PR0701MB2923.eurprd07.prod.outlook.com (10.168.92.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.7; Thu, 23 Feb 2017 14:14:52 +0000 Received: from DB5EUR03FT033.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::206) by VI1PR0701CA0038.outlook.office365.com (2603:10a6:800:90::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.2 via Frontend Transport; Thu, 23 Feb 2017 14:14:52 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.35 as permitted sender) Received: from hybrid2.ext.net.nokia.com (131.228.2.35) by DB5EUR03FT033.mail.protection.outlook.com (10.152.20.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.10 via Frontend Transport; Thu, 23 Feb 2017 14:14:52 +0000 Received: from fihe3nok1348.nsn-intra.net (10.158.36.136) by fihe3nok1346.nsn-intra.net (10.158.36.134) with Microsoft SMTP Server (TLS) id 15.1.466.34; Thu, 23 Feb 2017 16:14:50 +0200 Received: from mailrelay.int.nokia.com (10.130.128.21) by fihe3nok1348.nsn-intra.net (10.158.36.136) with Microsoft SMTP Server (TLS) id 15.1.466.34 via Frontend Transport; Thu, 23 Feb 2017 16:14:50 +0200 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v1NEE9bV029212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Feb 2017 16:14:09 +0200 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v1NEE8UF029180 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Thu, 23 Feb 2017 16:14:09 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Thu, 23 Feb 2017 16:14:08 +0200 Message-ID: <1487859248-23273-4-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1487859248-23273-1-git-send-email-petri.savolainen@linaro.org> References: <1487859248-23273-1-git-send-email-petri.savolainen@linaro.org> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.35; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(39850400002)(39410400002)(39450400003)(39840400002)(39860400002)(2980300002)(189002)(199003)(5003940100001)(36756003)(22756006)(76176999)(33646002)(575784001)(86362001)(450100001)(2906002)(47776003)(189998001)(50986999)(305945005)(97736004)(2351001)(106466001)(105596002)(50466002)(626004)(77096006)(92566002)(2950100002)(48376002)(81156014)(8676002)(68736007)(6916009)(81166006)(38730400002)(110136004)(8936002)(53936002)(50226002)(5660300001)(356003)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0701MB2923; H:hybrid2.ext.net.nokia.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB5EUR03FT033; 1:7IDovQ+UCAzCB5DY2Y4rdvxWSu0hByhcUU1VUulu6AesaupkZ2LvvIorpWsSeIR6OaA4CUiaGqWtFPTULHrOeSEw1fs7QZyy9ofGONQV+5rndlFouI1QciDrNvRwP9P+hqsKPAPQZ2FhCMtpaBYR+/6QP8Z/0UeemSs96D2VW/M90szblUH0JlVMmbg1B0XHJdZJT9drAmTWzSPmnUIyTjfXkSshq8KveQYs/mDl84FYAU/nr43qDr7LT/drwHvQflIG9AVYCdu8Dw6qkH40Ld5uXH19ph63LX9oP3xtIlqKvAkLmjA8lGN4O7OeCPaKfwdQyoeDxU+2Ltub6A8jfMErRFMJWHBOt1rMYr7mINd2QMSf5+J8CU1tNaj8kOtlSoSJU8SeQi3WW/jDujNasoUH5FUl2WvjtboErOzwW01/zGdIiAtFQHYcGZK0AskkKR7F5ZfqSsL+NUSGBpqfSA== X-MS-Office365-Filtering-Correlation-Id: db2e7137-d9b5-481e-993c-08d45bf655c0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:HE1PR0701MB2923; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2923; 3:VfV6T05Rnv0oqCy8pr/vka8G9NgAkgYbvJi+xiDJvm3RU3QbWUJhwPNVVqWWotIbJPbgfQJjEkMmEck7roCdvAIOPPEaDziY3BYCHyRNL0X3l7JGXToO63lT1bhVMh6Yclx+qa9c3VssuEa33kzh7uQxX/NrGEqYr29oaP6uvP0rh7ZBFFvld5uZjh3BdS1RjyqbUr8TYalKLAnzTPmsrUBHPwRkXNeH+nMw1XF2ibUu4uVfhzUrOhroqeF1//yFIq1/waNYMfyyLCP2ndidUijqfSwAddrmYxvxtjKXuiZvxZ8cokP9TbeliCYqzVmDI4RZvm10zjxm5+E/RbcPxzKVoG83HgfgoS4NJJzhJblcekJWjDSQPqY/pQ6mX282; 25:Fq8NXFLprCN0QL6MIdz1Bmk0144OkoCA24fL48T3VR6eAkdW72pAaaD4T8X8evX5FESZLVRxwSIECvFTI1R7OJwyGOWDu2ZlGDJFLDD7WxBKklFxvXIKdgER2ac4ktge03kIyyTnwSQmXCb4TtdVhllHL3srMkXPOhc1AhGaUFqaGfNaujcFmNcVTfEZF1DtTU5w21pOORf7EYk7W+Z4KwzgH/cCEPuCjBBRa+wk7bofiEk5t7NGICUx7oLnzm0tCDmplw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1BDIfhWxmWE2qgnQeEGfe1kJpStO4tyiCFOnBJaTgCfgzFgwMQpU8hkNsyDK/xl3CJQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13016025)(13018025)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(20161123558025)(6072148); SRVR:HE1PR0701MB2923; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0701MB2923; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2923; 4:qpsQATNNeY5C10j3W77eXZy91fGhwSsf7goQJZaQ+jOS67zY6e9ynHTncfDXBr/pZAhmRfYmhAX9oYDw9AtQ3peGCB12WXcFRRSo3mUaS30dr5y0gBSCUBGS/+MAE6Inn8Dl+UEq5H3i2oiWBnV5X2IjajjDyyVd/voiUyU7n+ft3C085RUQ4/ynZsXrIxtBetoK1M3OxH9CL0aC+vwJfVgVvMSmkr02eHDY8YKKMYrfMxlIOFxsS8OZi70kQZ+qLh/9N7m4msMy/0UZ2cxZyfKg+aIoNcqFaHpTFYosDd46WPrs+IGQiRPOTZirpmAnKGFUr7FMEyQZD3tB7xVI8fGFc/Na2tms0F8ACN7ioL7fZxtH82gCAJl8xMAc3chy/RnmaRCJA05J/2+wjPuHfdNJGO/qVOPnDQKZv8oKGkNVyLJDs284eQJTGSMuLLewXwMHD0s9BYpsKtpyifaePGAUx5g5ZK/BfgYGPtjdWLzKVl5zxSPX1Y3eQWai9urOfPjybB4UyaKAT7vPAYu3mRD3jp1NQc+AHsumavBBlIVFcjNxqbZmIDoXXawVnmKc+MBJlwlXvUFN6DhJ3fIwoWhkFWDBdGGfjy7QKifuUBiWwqdsa6uTRNbb4jLWWyj3nFOKjCk8uahJySV4ihnZtJcLZnrNAdsMt5UX7SvCoj4= X-Forefront-PRVS: 02272225C5 X-Microsoft-Exchange-Diag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XCKHcotgRQE7WESNtwze5wDpWjWk1xPAOOMlHvHU7lSCxTI4lZJuv8NaTVgrKXf20+lTn4CRNiMhDIsSu9a7WPMOx8ubVxkZ1AP2q0x X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2923; 6:I2RjHIPm+tNyeW8z4Lch074VzURwLuyTgDl6OdXuhj8eBMrzBxBZjRREG4UKoA8h55CY6pq25UvIQ0ZKMnayaqCNXrVGB7JdH5acvrLunA90fVFv3o2Saz3GJDmi/r9NmZLL9/QFNYA98cZcQkyRVtGpPqoWjtBseTkT5xcVr/aCmcRTAsPKykt9iVmx+7A7/oNxguIS1pQZHaOfJH2rJafIlMj3qW5hq7HXiHy3gNL3kcYpEn2LXyQtzKkO/cy0n3UCRbZDcjd5jLQv9fobNoCBBLYvXhu6b+nqBAwpofFMy7aQjf36hH1LVFDpz5dWBLTji47FsP83hyLZ81dWfNYx4AmiOXBq0/a4Rh4gnFMj8IO+ypcfR+aq2+8Fts66wYYJCUgv7pSHlBDfdVQZ5PoeS+j8GONw0soHvJLsR8I=; 5:4kW9Gsz9nqLO/RJqjD5dF9VkLhUvg3o+nCL6zGpWery+efz1X59lUI5ON+glvw+kUWZgminEMBjp7wgeR9BdJR3lMMlXdnyRwnJTIktu2CFBbkltoSZE0hk6OeJRDNDLEx1dM1WZwxPch85GA2iimw==; 24:6WeBXdH8wsJPGpYTLkrAypuBf9OAj864kjnRl2SNZlZBrFeC8NGpnFVQnSHCWlR2FcYmwXn02gzSWuDMkkQS1+fGtDsvf9XP9thvc9XdHx4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2923; 7:/7d0f5x979ogYgp2FYVw91XDvD0eVdBTpA/T6Xex3ovxovK1sZnH0vlkde8o6Ic6+D0vKtIvXPpyoebr//hMnSwzt/bV9n3Fyb+CVZQEuExNiYk2Cq46LmIQPjLC4ZPjkRSpl+hLhNtVuUq7DJviIi9YCg4EwonfeUzB8etVXYqJ5JKJeO5oY17FAa1GesFKQOkdvSIMiDM9PXRmJ//Pkrq0LQYVu1tGmIuzGkw0TxA5YYnvdMKrEL42nl0kAwBphgiMOpoxBYd+xvBCBf30QWVa5NoJcjBlHDHAPHFuvLRQXxmLOF+mJseBTo7a3XMp6Soz+A7egAtTZB0JYbKvQw== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2017 14:14:52.3756 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.35]; Helo=[hybrid2.ext.net.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0701MB2923 Subject: [lng-odp] [API-NEXT PATCH 4/4] api: crypto: enforce deprecated API status 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" Used ODP_DEPRECATED to control if deprecated API definitions are visible in the API or not. Signed-off-by: Petri Savolainen --- include/odp/api/spec/crypto.h | 16 +++++++++++-- platform/linux-generic/odp_crypto.c | 45 +++++++++++++++++++++++++------------ 2 files changed, 45 insertions(+), 16 deletions(-) -- 2.8.1 diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 9855bf9..bba1c08 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -15,6 +15,8 @@ #define ODP_API_CRYPTO_H_ #include +#include + #ifdef __cplusplus extern "C" { #endif @@ -81,11 +83,13 @@ typedef enum { */ ODP_CIPHER_ALG_AES_GCM, +#if ODP_DEPRECATED /** @deprecated Use ODP_CIPHER_ALG_AES_CBC instead */ ODP_CIPHER_ALG_AES128_CBC, /** @deprecated Use ODP_CIPHER_ALG_AES_GCM instead */ ODP_CIPHER_ALG_AES128_GCM +#endif } odp_cipher_alg_t; @@ -114,6 +118,7 @@ typedef enum { */ ODP_AUTH_ALG_AES_GCM, +#if ODP_DEPRECATED /** @deprecated Use ODP_AUTH_ALG_MD5_HMAC instead */ ODP_AUTH_ALG_MD5_96, @@ -122,6 +127,7 @@ typedef enum { /** @deprecated Use ODP_AUTH_ALG_AES_GCM instead */ ODP_AUTH_ALG_AES128_GCM +#endif } odp_auth_alg_t; /** @@ -144,12 +150,13 @@ typedef union odp_crypto_cipher_algos_t { /** ODP_CIPHER_ALG_AES_GCM */ uint32_t aes_gcm : 1; - +#if ODP_DEPRECATED /** @deprecated Use aes_cbc instead */ uint32_t aes128_cbc : 1; /** @deprecated Use aes_gcm instead */ uint32_t aes128_gcm : 1; +#endif } bit; /** All bits of the bit field structure @@ -176,7 +183,7 @@ typedef union odp_crypto_auth_algos_t { /** ODP_AUTH_ALG_AES_GCM */ uint32_t aes_gcm : 1; - +#if ODP_DEPRECATED /** @deprecated Use md5_hmac instead */ uint32_t md5_96 : 1; @@ -185,6 +192,7 @@ typedef union odp_crypto_auth_algos_t { /** @deprecated Use aes_gcm instead */ uint32_t aes128_gcm : 1; +#endif } bit; /** All bits of the bit field structure @@ -298,8 +306,10 @@ typedef struct odp_crypto_session_param_t { } odp_crypto_session_param_t; +#if ODP_DEPRECATED /** @deprecated Use odp_crypto_session_param_t instead */ typedef odp_crypto_session_param_t odp_crypto_session_params_t; +#endif /** * Crypto API per packet operation parameters @@ -354,8 +364,10 @@ typedef struct odp_crypto_op_param_t { } odp_crypto_op_param_t; +#if ODP_DEPRECATED /** @deprecated Use odp_crypto_op_param_t instead */ typedef odp_crypto_op_param_t odp_crypto_op_params_t; +#endif /** * Crypto API session creation return code diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index b53b0fc..de03e7e 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -642,12 +642,13 @@ int odp_crypto_capability(odp_crypto_capability_t *capa) capa->auths.bit.sha256_hmac = 1; capa->auths.bit.aes_gcm = 1; - /* Deprecated */ +#if ODP_DEPRECATED capa->ciphers.bit.aes128_cbc = 1; capa->ciphers.bit.aes128_gcm = 1; capa->auths.bit.md5_96 = 1; capa->auths.bit.sha256_128 = 1; capa->auths.bit.aes128_gcm = 1; +#endif capa->max_sessions = MAX_SESSIONS; @@ -738,6 +739,7 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, { int rc; odp_crypto_generic_session_t *session; + int aes_gcm = 0; /* Default to successful result */ *status = ODP_CRYPTO_SES_CREATE_ERR_NONE; @@ -780,17 +782,21 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, rc = process_des_param(session); break; case ODP_CIPHER_ALG_AES_CBC: - /* deprecated */ +#if ODP_DEPRECATED case ODP_CIPHER_ALG_AES128_CBC: +#endif rc = process_aes_param(session); break; - case ODP_CIPHER_ALG_AES_GCM: - /* deprecated */ +#if ODP_DEPRECATED case ODP_CIPHER_ALG_AES128_GCM: + if (param->auth_alg == ODP_AUTH_ALG_AES128_GCM) + aes_gcm = 1; + /* Fallthrough */ +#endif + case ODP_CIPHER_ALG_AES_GCM: /* AES-GCM requires to do both auth and * cipher at the same time */ - if (param->auth_alg == ODP_AUTH_ALG_AES_GCM || - param->auth_alg == ODP_AUTH_ALG_AES128_GCM) + if (param->auth_alg == ODP_AUTH_ALG_AES_GCM || aes_gcm) rc = process_aes_gcm_param(session); else rc = -1; @@ -805,6 +811,8 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, return -1; } + aes_gcm = 0; + /* Process based on auth */ switch (param->auth_alg) { case ODP_AUTH_ALG_NULL: @@ -812,22 +820,27 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, rc = 0; break; case ODP_AUTH_ALG_MD5_HMAC: - /* deprecated */ +#if ODP_DEPRECATED case ODP_AUTH_ALG_MD5_96: +#endif rc = process_md5_param(session, 96); break; case ODP_AUTH_ALG_SHA256_HMAC: - /* deprecated */ +#if ODP_DEPRECATED case ODP_AUTH_ALG_SHA256_128: +#endif rc = process_sha256_param(session, 128); break; - case ODP_AUTH_ALG_AES_GCM: - /* deprecated */ +#if ODP_DEPRECATED case ODP_AUTH_ALG_AES128_GCM: + if (param->cipher_alg == ODP_CIPHER_ALG_AES128_GCM) + aes_gcm = 1; + /* Fallthrough */ +#endif + case ODP_AUTH_ALG_AES_GCM: /* AES-GCM requires to do both auth and * cipher at the same time */ - if (param->cipher_alg == ODP_CIPHER_ALG_AES_GCM || - param->cipher_alg == ODP_CIPHER_ALG_AES128_GCM) { + if (param->cipher_alg == ODP_CIPHER_ALG_AES_GCM || aes_gcm) { session->auth.func = null_crypto_routine; rc = 0; } else { @@ -852,10 +865,14 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, int odp_crypto_session_destroy(odp_crypto_session_t session) { odp_crypto_generic_session_t *generic; + int aes_gcm = 0; generic = (odp_crypto_generic_session_t *)(intptr_t)session; - if (generic->p.cipher_alg == ODP_CIPHER_ALG_AES128_GCM || - generic->p.cipher_alg == ODP_CIPHER_ALG_AES_GCM) +#if ODP_DEPRECATED + if (generic->p.cipher_alg == ODP_CIPHER_ALG_AES128_GCM) + aes_gcm = 1; +#endif + if (generic->p.cipher_alg == ODP_CIPHER_ALG_AES_GCM || aes_gcm) EVP_CIPHER_CTX_free(generic->cipher.data.aes_gcm.ctx); memset(generic, 0, sizeof(*generic)); free_session(generic);