Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3414456rwa; Tue, 23 Aug 2022 04:30:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR7/C5G0EtVEGZuSwsogf0Ci6wPUkw4VmTk/u14nwGBINJtqv/tGMkSm6AJBSHGyoQMTWvFP X-Received: by 2002:a17:903:4053:b0:172:d8ea:7c25 with SMTP id n19-20020a170903405300b00172d8ea7c25mr12552270pla.26.1661254237567; Tue, 23 Aug 2022 04:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254237; cv=none; d=google.com; s=arc-20160816; b=nrFkmyzZqN9lYfZZqng3pnBvDT7GVGqm3t/dbBsRCYl4Rn7Dd67gUfL/0D5zN6TSDl FJwbQqY9X3pwn43ji+7MrtPwyXEALGa2c9AwDchgZmSQu3tu74uOZvkFuxP0k51RqlEz ZrrZtr2GAimGvPGSMEG+wv8MtBlVF1G31UOQyIeEkqAz8Cjs8VRhmmfuWBZdTKtyKY/v gUJOFV696HRwv7/WZgi4ZJjlCcReInLYFHrsbIh2VO2JrP6RBT1AJzYKYCZDhFBSv5m6 AthIvPbIL2jy2HdYGM/wlYLz/Q6Mj04Qi5zZzUNGmY+m+lsty9ZbvgwSkb3oE+SOKFPI zU9w== 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=isnu4F8AqT8ADm7iNSdiNFV+dLdjCHHYgm+rjKcVAuQ=; b=fWtuUO29r5Q8D9fHfQ+3evtNZk7op+cZZ/H9XCHg4qnLgI+LsH4i6atEuT8YHkHnHm bG7pN8wUHWMRlL3swRfD5PYlgy253ldx4n74c4lY77TBefWBxDUcq0A0mRZuWlPg6e3M Kels87cDNOL6nP5fDL/8Ve1G3CBdbcGj5QVER3q0v/D+FHx0f5VcuVIxExtzw74I8iL/ iKiHsX646Ccx04AC6Vx+oVH3JQCk5OvzE/yE3Oq5hXx91gOH6F6lqIIQ8K2z9HQVHfWh /UjTHzxWBFHuE61Ej9Rlq6dAE/OdVx1Td+Z+e+2uQlByAj7ERo0uxDqZSkUJuSe9u60+ syPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GJ4W21Yf; 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 e8-20020a656488000000b0041da5a05f4csi16283396pgv.526.2022.08.23.04.30.26; Tue, 23 Aug 2022 04:30:37 -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=GJ4W21Yf; 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 S1348824AbiHWLEk (ORCPT + 99 others); Tue, 23 Aug 2022 07:04:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356599AbiHWK74 (ORCPT ); Tue, 23 Aug 2022 06:59:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BE85AE9D6; Tue, 23 Aug 2022 02:14:07 -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 ams.source.kernel.org (Postfix) with ESMTPS id 510F6B81C86; Tue, 23 Aug 2022 09:13:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 807E4C433B5; Tue, 23 Aug 2022 09:13:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246032; bh=buNJpeB5tJIUb/TRYCJmQLyE/2aGLkLTIGN2CS75dns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GJ4W21YfDnyIipjKC9xafQZdCG8uvA2x4a7H1QsK1F2uGaFFjnjqZVWZQjt3wLvEm XP0ycd6vL2gms0fAwGx+3U5pX98H72/iU9XCPnD9PyUHKp34vYqLWKUXQtyWTOpWQ9 uMiFNlF063uvv/eJVrXRaY5dcaa9JcHqlsCUpqH4= 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 4.19 240/287] tools build: Switch to new openssl API for test-libcrypto Date: Tue, 23 Aug 2022 10:26:49 +0200 Message-Id: <20220823080109.163592043@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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(-) diff --git a/tools/build/feature/test-libcrypto.c b/tools/build/feature/test-libcrypto.c index a98174e0569c..bc34a5bbb504 100644 --- 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]); -- 2.37.2