From patchwork Thu Mar 30 13:58:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 96297 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp252794qgd; Thu, 30 Mar 2017 07:01:42 -0700 (PDT) X-Received: by 10.237.38.65 with SMTP id z59mr6281461qtc.215.1490882502850; Thu, 30 Mar 2017 07:01:42 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c67si1869684qkf.310.2017.03.30.07.01.42; Thu, 30 Mar 2017 07:01:42 -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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 6A9BB60C60; Thu, 30 Mar 2017 14:01:42 +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 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 328E563539; Thu, 30 Mar 2017 13:59:35 +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 A5BB360C61; Thu, 30 Mar 2017 13:59:23 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0113.outbound.protection.outlook.com [104.47.0.113]) by lists.linaro.org (Postfix) with ESMTPS id 32C6C60BED for ; Thu, 30 Mar 2017 13:59:19 +0000 (UTC) Received: from HE1PR0701CA0019.eurprd07.prod.outlook.com (10.165.214.157) by HE1PR07MB0811.eurprd07.prod.outlook.com (10.162.24.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.2; Thu, 30 Mar 2017 13:59:17 +0000 Received: from DB5EUR03FT034.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::209) by HE1PR0701CA0019.outlook.office365.com (2603:10a6:3:5::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.8 via Frontend Transport; Thu, 30 Mar 2017 13:59:16 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.240 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.240) by DB5EUR03FT034.mail.protection.outlook.com (10.152.20.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1005.5 via Frontend Transport; Thu, 30 Mar 2017 13:59:16 +0000 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 v2UDwuFt028536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 30 Mar 2017 16:58:56 +0300 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 v2UDwu7N028515 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Thu, 30 Mar 2017 16:58:56 +0300 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Thu, 30 Mar 2017 16:58:56 +0300 Message-ID: <1490882336-13721-5-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1490882336-13721-1-git-send-email-petri.savolainen@linaro.org> References: <1490882336-13721-1-git-send-email-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39410400002)(39400400002)(39850400002)(39840400002)(39860400002)(2980300002)(189002)(199003)(9170700003)(36756003)(76176999)(50986999)(110136004)(106466001)(2950100002)(6916009)(33646002)(5660300001)(105596002)(2906002)(38730400002)(575784001)(2351001)(22756006)(48376002)(189998001)(305945005)(8936002)(86362001)(47776003)(50226002)(77096006)(81166006)(53936002)(50466002)(5003940100001)(356003)(8676002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB0811; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB5EUR03FT034; 1:LrtMlz5692HcIPx5GSz2IT8sl+NXMbzlMfr+yJxjnJeoVog0aSx+32qIJC1ZTorC1WKOiphsctfkTM5Ny0ug6jQFIuiBIZiQKwA3n/C2fKIv6UxrGcZS1jNuqFD+qhw0mWyF5naRBjoOOHng+j2RPVWBC8oVL5UEXSp9VM9fYm0mT/1gYin3cegbYx5bvT4y6K53o0aoXBOnecfQ+XdhNx/vcK5ECUlmAjVmh8n50dOlpJvyb53bhaf95/tvUiWWhtTk0pVezk5CCgTLH/vdaQeNxPq7wOZ1yx/sISz0rqN1sCiAduRgH2GZBynhCgpGV4Nfup9J+sxAWjGdxQlOYX2YnKGcWR+FBJPo8Q0ReksjmK/4GhicBOkMA4tuY9KIC+MJrGCtZPnsz2hF+oGOe6aHDCG4G0KRks9S8LZd2xex6oIj1KsKo7KunpSoS/zvDJf0zWAhgO8hoWI6H+izZzlE0jBGpYEU3YBkZ8dU0N7UlieRMVeiuoP2JgQ4E1cMqhqU0KMjPzlzyi2d70ZOiw== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8817e1c5-0e4a-414c-2cee-08d47774f477 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(2017030256075)(201703131423075)(201703031133081); SRVR:HE1PR07MB0811; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0811; 3:LaKI2QCDrX4hUWU5khvMOWI5uBpq7Vbsh1/MmLPhG6auAyR427+AqieGYXwxo1Ybfy2csGE4ahBPNtCWsKMs+IMEnRbOsJMEdl23q7oFIPLJdDKRvQBhYDYJdj1ugsr+5rASjEQu6FjvXGVv7+sd5hXomRZuYWFF/DgRESfodS9T3Y1XoSZqB38CZ8eWQeLsDWZcLBURAmgV/9JcTbAa6SvuACSfzroNA91PLaDhxihWCti35H9ovP566u8ezhh8PHSrRPm2k4VMi2ODUkm74giiWjO967PhdkE/QGPAbS1FGKKP1ja9LhlT/HFkPKweCm11f/86M7dZsGJ9qQKikCuu00RFxugAnxwOEKkD+vaK3sjYySmAFkkcft8+i/P1Wj5eBRhlg834zI1WppIOh7UMuYH8ku/v/314heM6CUw3kr3D+0TlVSd5XE3qNGGk6xBM0WVqV8foJCu95Sd3jG07iFW0NGb5QE8dNihvZ8qfnjRy5cw72aHImVw/glNj X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0811; 25:EY6xunSTX3hnMPpWS/ChTL52c/5GAtLZfMcc272FJFTLqD6AiltltLjYycRGdeZ56oQzTrv8+gG18t4jnU9yIm5+s6qt84qMzfF9COkR2rWS+q2vWZ1W88NMCpJN09V340pPms1p2nXsmB3NwIbPhctNZjAzXwUTbldQbQGfxS1UqkOtwmTG1Aa4JkKhZ+DdyMWBAppqIAxJggJwP1iagZu1+9cpf0v0I+dvTypBEW/Uq/Q8muK528G6Vg5lCn3zyfLwzKm1kxLorPWWq6hGAh8JhZR5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kq8js5M9wmaW/0n+6drCmcPFdLDDEv668m4DHZS7++BQei0xiSg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(13013025)(5005006)(13023025)(13021025)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:HE1PR07MB0811; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB0811; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0811; 4:pRj48JN8eSIs0/rBkS/B8qsvHoB543ux8YVvB5YRoANWZYuBSSjn0i3mLv/Hoba98ClJDivntXmrRmhRat82xHwB+Gs40ru2HBN5AtUwqDtcGD0J+vUSDaOcvz7nLGTDQEym0TxuxL9ucax4R8UKIe9oLs1Y+ShP9y+azh8quo6WrWPg0sLL51KoX45UAV9dljQe0E5eC4GlnP1US2ACrMqKfgckt8J45bvwcD9innEL9edJCLAXLSl5WPECzm6FP3uYtXFYAsxKzKGzTyK4syn98dsCkpD/FK06IBj+d3Vsqb40BSbvUMcQG+W/fvv4V+0LBNndKTaiImE5zl++LktIOxyb0quz3S5pP68AC9hZtY+ivUv8fL7xutuyFtbsnktEzG1a5gwAEVgLPlkf7pU8QiJ77ECH0F05IKqUrjPimpAe+LnTrrcc0XBF0ODGI6hg+NQQOZJ1AWYWhNtZUqs5ePAkpLNwWaSZVVVjBb7Ra52/H2kQN3tzpysgoE6j5AR3FBUWQyiUSVXlYfBrb8BLg/vClh3le5kwyxjTF839IF8lHMVtz4fSZFB930lOxwGaptTrY5BmykTVHfKFFShn9dXuqB7M3S5lle4c+bRlz6Kv1Pw3g7JsifZ0CRijoadb+2qpLDSPYkfiuU3IrRxVZoN7RUXYMMA397sfUrqTeFwDbQ0KNu9FN81yHVqHHFi5aE6+5ShbbQtsJ1qakjmgZnk6cL3gXS/MPZ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8aYcAiuSUdfWYM/YwcGscyJNioAT4xEqfWNomRFSVAiibgJpVwCsKzKH673Uyx0XqUmzKNuACirUF4H601U5vNN2drjM0FJjpBXHZIP6tN9krcViqprw2NS67REorsc+XeOWe1lAS/5NV2pc/SteMOHGsNVD0mOmw== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2017 13:59:16.5570 (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.240]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB0811 Subject: [lng-odp] [API-NEXT PATCH v2 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_DEPRECATE() to control if deprecated API definitions are visible in the API or not. Signed-off-by: Petri Savolainen --- include/odp/api/spec/crypto.h | 29 ++++++++++++++---------- platform/linux-generic/odp_crypto.c | 45 +++++++++++++++++++++++++------------ 2 files changed, 48 insertions(+), 26 deletions(-) -- 2.8.1 Reviewed-by: Dmitry Eremin-Solenikov diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index d30f050..181c0cc 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 @@ -82,10 +84,10 @@ typedef enum { ODP_CIPHER_ALG_AES_GCM, /** @deprecated Use ODP_CIPHER_ALG_AES_CBC instead */ - ODP_CIPHER_ALG_AES128_CBC, + ODP_DEPRECATE(ODP_CIPHER_ALG_AES128_CBC), /** @deprecated Use ODP_CIPHER_ALG_AES_GCM instead */ - ODP_CIPHER_ALG_AES128_GCM + ODP_DEPRECATE(ODP_CIPHER_ALG_AES128_GCM) } odp_cipher_alg_t; @@ -127,13 +129,14 @@ typedef enum { ODP_AUTH_ALG_AES_GCM, /** @deprecated Use ODP_AUTH_ALG_MD5_HMAC instead */ - ODP_AUTH_ALG_MD5_96, + ODP_DEPRECATE(ODP_AUTH_ALG_MD5_96), /** @deprecated Use ODP_AUTH_ALG_SHA256_HMAC instead */ - ODP_AUTH_ALG_SHA256_128, + ODP_DEPRECATE(ODP_AUTH_ALG_SHA256_128), /** @deprecated Use ODP_AUTH_ALG_AES_GCM instead */ - ODP_AUTH_ALG_AES128_GCM + ODP_DEPRECATE(ODP_AUTH_ALG_AES128_GCM) + } odp_auth_alg_t; /** @@ -158,10 +161,11 @@ typedef union odp_crypto_cipher_algos_t { uint32_t aes_gcm : 1; /** @deprecated Use aes_cbc instead */ - uint32_t aes128_cbc : 1; + uint32_t ODP_DEPRECATE(aes128_cbc) : 1; /** @deprecated Use aes_gcm instead */ - uint32_t aes128_gcm : 1; + uint32_t ODP_DEPRECATE(aes128_gcm) : 1; + } bit; /** All bits of the bit field structure @@ -196,13 +200,14 @@ typedef union odp_crypto_auth_algos_t { uint32_t aes_gcm : 1; /** @deprecated Use md5_hmac instead */ - uint32_t md5_96 : 1; + uint32_t ODP_DEPRECATE(md5_96) : 1; /** @deprecated Use sha256_hmac instead */ - uint32_t sha256_128 : 1; + uint32_t ODP_DEPRECATE(sha256_128) : 1; /** @deprecated Use aes_gcm instead */ - uint32_t aes128_gcm : 1; + uint32_t ODP_DEPRECATE(aes128_gcm) : 1; + } bit; /** All bits of the bit field structure @@ -317,7 +322,7 @@ typedef struct odp_crypto_session_param_t { } odp_crypto_session_param_t; /** @deprecated Use odp_crypto_session_param_t instead */ -typedef odp_crypto_session_param_t odp_crypto_session_params_t; +typedef odp_crypto_session_param_t ODP_DEPRECATE(odp_crypto_session_params_t); /** * Crypto API per packet operation parameters @@ -373,7 +378,7 @@ typedef struct odp_crypto_op_param_t { } odp_crypto_op_param_t; /** @deprecated Use odp_crypto_op_param_t instead */ -typedef odp_crypto_op_param_t odp_crypto_op_params_t; +typedef odp_crypto_op_param_t ODP_DEPRECATE(odp_crypto_op_params_t); /** * Crypto API session creation return code diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 2ba504b..228e598 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -644,12 +644,13 @@ int odp_crypto_capability(odp_crypto_capability_t *capa) capa->auths.bit.sha512_hmac = 0; capa->auths.bit.aes_gcm = 1; - /* Deprecated */ +#if ODP_DEPRECATED_API 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; @@ -740,6 +741,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; @@ -782,17 +784,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_API case ODP_CIPHER_ALG_AES128_CBC: +#endif rc = process_aes_param(session); break; - case ODP_CIPHER_ALG_AES_GCM: - /* deprecated */ +#if ODP_DEPRECATED_API 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; @@ -807,6 +813,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: @@ -814,22 +822,27 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, rc = 0; break; case ODP_AUTH_ALG_MD5_HMAC: - /* deprecated */ +#if ODP_DEPRECATED_API case ODP_AUTH_ALG_MD5_96: +#endif rc = process_md5_param(session, 96); break; case ODP_AUTH_ALG_SHA256_HMAC: - /* deprecated */ +#if ODP_DEPRECATED_API case ODP_AUTH_ALG_SHA256_128: +#endif rc = process_sha256_param(session, 128); break; - case ODP_AUTH_ALG_AES_GCM: - /* deprecated */ +#if ODP_DEPRECATED_API 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 { @@ -854,10 +867,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_API + 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);