lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 8 Aug 2022 18:14:48 +0200
From:   Daniel Borkmann <daniel@...earbox.net>
To:     Roberto Sassu <roberto.sassu@...wei.com>, quentin@...valent.com,
        ast@...nel.org, andrii@...nel.org, martin.lau@...ux.dev,
        song@...nel.org, john.fastabend@...il.com, kpsingh@...nel.org,
        sdf@...gle.com, peterz@...radead.org, mingo@...hat.com,
        acme@...nel.org, terrelln@...com, nathan@...nel.org,
        ndesaulniers@...gle.com
Cc:     bpf@...r.kernel.org, linux-perf-users@...r.kernel.org,
        llvm@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] build: Switch to new openssl API for test-libcrypto

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@...wei.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]);
>   
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ