From: Daniel Borkmann <daniel@iogearbox.net>
To: Roberto Sassu <roberto.sassu@huawei.com>,
quentin@isovalent.com, ast@kernel.org, andrii@kernel.org,
martin.lau@linux.dev, song@kernel.org, john.fastabend@gmail.com,
kpsingh@kernel.org, sdf@google.com, peterz@infradead.org,
mingo@redhat.com, acme@kernel.org, terrelln@fb.com,
nathan@kernel.org, ndesaulniers@google.com
Cc: bpf@vger.kernel.org, linux-perf-users@vger.kernel.org,
llvm@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] build: Switch to new openssl API for test-libcrypto
Date: Mon, 8 Aug 2022 18:14:48 +0200 [thread overview]
Message-ID: <5f867295-10d2-0085-d1dc-051f56e7136a@iogearbox.net> (raw)
In-Reply-To: <20220719170555.2576993-4-roberto.sassu@huawei.com>
Hi Arnaldo,
On 7/19/22 7:05 PM, Roberto Sassu wrote:
> 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.
>
> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Given rest of the tooling fixes from Andres Freund went via perf tree and the
below is perf related as well, I presume you'll pick this up, too?
[0] https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/log/?h=perf/core
> 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 <openssl/evp.h>
> #include <openssl/sha.h>
> #include <openssl/md5.h>
>
> 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]);
>
>
next prev parent reply other threads:[~2022-08-08 16:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-19 17:05 [PATCH 1/4] tools, build: Retry detection of bfd-related features Roberto Sassu
2022-07-19 17:05 ` [PATCH 2/4] bpftool: Complete libbfd feature detection Roberto Sassu
2022-07-20 20:07 ` Quentin Monnet
2022-07-19 17:05 ` [PATCH 3/4] perf: Remove FEATURE_CHECK_LDFLAGS-disassembler-four-args Roberto Sassu
2022-07-19 17:05 ` [PATCH 4/4] build: Switch to new openssl API for test-libcrypto Roberto Sassu
2022-08-08 16:14 ` Daniel Borkmann [this message]
2022-08-08 18:33 ` Arnaldo Carvalho de Melo
2022-08-09 15:15 ` Arnaldo Carvalho de Melo
2022-08-09 15:21 ` Arnaldo Carvalho de Melo
2022-08-09 15:28 ` Roberto Sassu
2022-08-09 16:01 ` Roberto Sassu
2022-08-09 17:00 ` Andres Freund
2022-08-09 19:04 ` Arnaldo Carvalho de Melo
2022-08-09 19:10 ` Arnaldo Carvalho de Melo
2022-08-09 15:21 ` Quentin Monnet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5f867295-10d2-0085-d1dc-051f56e7136a@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=acme@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=martin.lau@linux.dev \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=quentin@isovalent.com \
--cc=roberto.sassu@huawei.com \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=terrelln@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).