From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 87A454297D; Tue, 18 Apr 2023 16:56:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0991C42BB1; Tue, 18 Apr 2023 16:56:24 +0200 (CEST) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mails.dpdk.org (Postfix) with ESMTP id 4813D410EA for ; Tue, 18 Apr 2023 16:56:23 +0200 (CEST) Received: by mail-wm1-f44.google.com with SMTP id d8-20020a05600c3ac800b003ee6e324b19so14986327wms.1 for ; Tue, 18 Apr 2023 07:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1681829783; x=1684421783; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2CViSyFCkxMoVhClgDlvQvINQ2EqCt3aXqU/hHN+W7Q=; b=AMxq3oGveHNvIEm/QgKwJaeXPRxrw8LgdbojFMz0svmtqVk4loyoe9f0rPBTVApRs0 10GG0wxahvVPsfcfe9zshUuh42lMvy9gFudZfwizXHa5MTTF8x+y9cCyeHpoe2wikg7E ihneVvU11o+zESkOyt7xJ17E5lbWnIWT9yUDjEDuxAE8EC6NvtDxZ8yiqfaxnFBvfNat Ql0XOCzKIgXDcZ+Py1010VnT6XF2tt8ZX+8E9UpdPKiR42+DInmHjvOJ5SgcMcuke//y UmIqupiwXOYF1zmR7i40Ielf0Jp95F6EliaDr8yJwINDbALOslBhPS/M+dmy1tN/H1wx KqqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681829783; x=1684421783; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2CViSyFCkxMoVhClgDlvQvINQ2EqCt3aXqU/hHN+W7Q=; b=SSRF5ViITT23vJ85NoMATLOqPqD03k6WqRhdC3W0OUINZxaizsSp8JpW90PjcKQt1E xsa8orbcj3L0K+zxrLZC9TyCkM4C44B7kgG6Aj/2rNg4NpQ8Xt2VoUyMeytby+Dn2wsw wSJDKuFUyGcKaKyMwTqRKx0MwcHgL+16YUOYvyylMN91HR+5q7pwZEMtaqQugpk5UAJd G5CZxuMwo2dnUbmXVStFhSV+5gJxT0axT4tigdySzAvpxL8I1XmqR4GAs1pUe4PB+ru5 gp+MIrNGjrMees9ZBGaoSISy0FVdhOLY3+W4gZhk+A1FL7nMl6c2L2cG8cqAJEOQjgpu N/LQ== X-Gm-Message-State: AAQBX9dFPNWInt4rb+ALScoO1B7wfMu0TROSl/FwamuFEeXcqEERc4yk zHQBHne5AgfMLQmywU0hDJCbebxholwQlpp5swM= X-Google-Smtp-Source: AKy350ZXJMyVGcdggXVSUczQMkgy5k5OwC2B6k9rC2Sa+6anXrjlfa3hZwdeyGlTpWVXHgB8I94Uiw== X-Received: by 2002:a1c:7706:0:b0:3ed:3033:496d with SMTP id t6-20020a1c7706000000b003ed3033496dmr12692849wmi.0.1681829782926; Tue, 18 Apr 2023 07:56:22 -0700 (PDT) Received: from arion.dev.6wind.com ([185.13.181.2]) by smtp.gmail.com with ESMTPSA id q9-20020a1ce909000000b003ee20b4b2dasm15053932wmc.46.2023.04.18.07.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 07:56:22 -0700 (PDT) From: Didier Pallard To: dev@dpdk.org Cc: stable@dpdk.org, Kai Ji , Daniel Mrzyglod , Tomasz Kulasek , Michal Kobylinski , Pablo de Lara , Slawomir Mrozowicz Subject: [PATCH] crypto/openssl: do not build useless workaround Date: Tue, 18 Apr 2023 16:56:19 +0200 Message-Id: <20230418145619.2648068-1-didier.pallard@6wind.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This workaround was needed before version 1.0.1f. Do not build it for versions >= 1.1. Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library") Signed-off-by: Didier Pallard Cc: stable@dpdk.org --- drivers/crypto/openssl/rte_openssl_pmd.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index e00db0facba5..a11885df8255 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -1195,8 +1195,11 @@ process_openssl_auth_encryption_gcm(struct rte_mbuf *mbuf_src, int offset, int srclen, uint8_t *aad, int aadlen, uint8_t *iv, uint8_t *dst, uint8_t *tag, EVP_CIPHER_CTX *ctx) { - int len = 0, unused = 0; + int len = 0; +#if OPENSSL_VERSION_NUMBER < 0x10100000L + int unused = 0; uint8_t empty[] = {}; +#endif if (EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, iv) <= 0) goto process_auth_encryption_gcm_err; @@ -1210,9 +1213,11 @@ process_openssl_auth_encryption_gcm(struct rte_mbuf *mbuf_src, int offset, srclen, ctx, 0)) goto process_auth_encryption_gcm_err; +#if OPENSSL_VERSION_NUMBER < 0x10100000L /* Workaround open ssl bug in version less then 1.0.1f */ if (EVP_EncryptUpdate(ctx, empty, &unused, empty, 0) <= 0) goto process_auth_encryption_gcm_err; +#endif if (EVP_EncryptFinal_ex(ctx, dst, &len) <= 0) goto process_auth_encryption_gcm_err; @@ -1274,8 +1279,11 @@ process_openssl_auth_decryption_gcm(struct rte_mbuf *mbuf_src, int offset, int srclen, uint8_t *aad, int aadlen, uint8_t *iv, uint8_t *dst, uint8_t *tag, EVP_CIPHER_CTX *ctx) { - int len = 0, unused = 0; + int len = 0; +#if OPENSSL_VERSION_NUMBER < 0x10100000L + int unused = 0; uint8_t empty[] = {}; +#endif if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, 16, tag) <= 0) goto process_auth_decryption_gcm_err; @@ -1292,9 +1300,11 @@ process_openssl_auth_decryption_gcm(struct rte_mbuf *mbuf_src, int offset, srclen, ctx, 0)) goto process_auth_decryption_gcm_err; +#if OPENSSL_VERSION_NUMBER < 0x10100000L /* Workaround open ssl bug in version less then 1.0.1f */ if (EVP_DecryptUpdate(ctx, empty, &unused, empty, 0) <= 0) goto process_auth_decryption_gcm_err; +#endif if (EVP_DecryptFinal_ex(ctx, dst, &len) <= 0) return -EFAULT; -- 2.30.2