Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3409674rwa; Tue, 23 Aug 2022 04:25:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR4xgNBno32V60uCo6HlNwx5RbhFUTCbHZoKfCzu6ndVWpYI/744g9qn6aED9C3VgLkZx5Q0 X-Received: by 2002:a63:d1f:0:b0:422:7774:1969 with SMTP id c31-20020a630d1f000000b0042277741969mr20015098pgl.88.1661253932708; Tue, 23 Aug 2022 04:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253932; cv=none; d=google.com; s=arc-20160816; b=tw37ysnwKVkyHc6QUsNkm8hO5s6WM1EB3Uu4+hBK3tgcwYuuQ+G16LdFYwcCugsG6+ GOHRbeOv0jySRTPLrQ9RmRJhEHMU/h+OMF67T4K+D2QZrZRehdq+oPGmN0ypuVrWKYJ9 VBmxSuEniOywdXJxsHD9qdyH2IS3ZGb9P3IVmHJh9VOmcuUGV0r01+81eguv+xBwYgwk /Dh+joPQxQQZ0d+sVgmLJnlxO8ryjo6SvtM28zQIEujhsSvnYBgeg2XQZB8hJ5zTOzWZ EQjuwifZuSzEnPtcX2TTcZTcsO8rnfAKwbBfVo/KL1yQWMLFbBAGr5pRHI/sScJBH6Rb n5EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MAhu86UfSn6TY2Q6qPtfmfPV3P+c3wLphsJ+bqbl5x4=; b=K/hSs6rMOs9nxP2wb/3v7ZuWu0p6iL3nBYJ5CGxaCiHLbKMgGk8/W9hCoEUSrB5GIW R9PGW+75HYsx3KkeoL/l3Gc9RL48RAZ4mY79fTaaXhF2iPTniNNaE0LYwebJlDpIAg6r Mbdf4Eww9XqzCQr8eX9B0mlITPIXGCyOeFUP8d/uhlZmvwt/fkFaWwjwGrw4y4Jywerp uY25646ay8BzmpChVDRtYtfrUmeqOcuePbJe6SrYKXJ44/kh/dd5+4ARfu3Yt7/cvYM0 WhYIgWs4bPh+mTpzMs7JAtRzGFy28ROVmzx7QBwYHgNNKFQJbl4gavlb1bQ6UESm4l1B /9WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pQxgqL2K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g21-20020a056a000b9500b005289aef5ec5si14387962pfj.311.2022.08.23.04.25.21; Tue, 23 Aug 2022 04:25:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pQxgqL2K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351758AbiHWKAd (ORCPT + 99 others); Tue, 23 Aug 2022 06:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352066AbiHWJ4V (ORCPT ); Tue, 23 Aug 2022 05:56:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A5896F569; Tue, 23 Aug 2022 01:47:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0281061377; Tue, 23 Aug 2022 08:47:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D365AC433D7; Tue, 23 Aug 2022 08:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244433; bh=69ovCRcumfGslh/oGLivZ4DIr8oJgQGwFuXGEqHGW5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pQxgqL2KgWzCKRnMVfjab2ZAUFyYUEVWVEF26pCj6zZFczFmfdAyGQICYPGWLXxga L4KaxEwVWPXbt7ITdk7ettvTS3XdJJvEfiuY1ff1cgbqD3dCnZ7U6GW0hAHl4rK5Z4 PXF5Tu9DJ3V3jZsUxlWmtf8K4wAEwkIhbUhU01cQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roberto Sassu , Alexei Starovoitov , Andrii Nakryiko , bpf@vger.kernel.org, Daniel Borkmann , Ingo Molnar , John Fastabend , KP Singh , llvm@lists.linux.dev, Martin KaFai Lau , Nathan Chancellor , Nick Desaulniers , Nick Terrell , Peter Zijlstra , Quentin Monnet , Song Liu , Stanislav Fomichev , Arnaldo Carvalho de Melo Subject: [PATCH 5.15 093/244] tools build: Switch to new openssl API for test-libcrypto Date: Tue, 23 Aug 2022 10:24:12 +0200 Message-Id: <20220823080102.118945451@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roberto Sassu commit 5b245985a6de5ac18b5088c37068816d413fb8ed upstream. Switch to new EVP API for detecting libcrypto, as Fedora 36 returns an error when it encounters the deprecated function MD5_Init() and the others. The error would be interpreted as missing libcrypto, while in reality it is not. Fixes: 6e8ccb4f624a73c5 ("tools/bpf: properly account for libbfd variations") Signed-off-by: Roberto Sassu Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: bpf@vger.kernel.org Cc: Daniel Borkmann Cc: Ingo Molnar Cc: John Fastabend Cc: KP Singh Cc: llvm@lists.linux.dev Cc: Martin KaFai Lau Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Nick Terrell Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Song Liu Cc: Stanislav Fomichev Link: https://lore.kernel.org/r/20220719170555.2576993-4-roberto.sassu@huawei.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/build/feature/test-libcrypto.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) --- a/tools/build/feature/test-libcrypto.c +++ b/tools/build/feature/test-libcrypto.c @@ -1,16 +1,23 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include int main(void) { - MD5_CTX context; + EVP_MD_CTX *mdctx; unsigned char md[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH]; unsigned char dat[] = "12345"; + unsigned int digest_len; - MD5_Init(&context); - MD5_Update(&context, &dat[0], sizeof(dat)); - MD5_Final(&md[0], &context); + mdctx = EVP_MD_CTX_new(); + if (!mdctx) + return 0; + + EVP_DigestInit_ex(mdctx, EVP_md5(), NULL); + EVP_DigestUpdate(mdctx, &dat[0], sizeof(dat)); + EVP_DigestFinal_ex(mdctx, &md[0], &digest_len); + EVP_MD_CTX_free(mdctx); SHA1(&dat[0], sizeof(dat), &md[0]);