Patch "tools build: Switch to new openssl API for test-libcrypto" has been added to the 5.19-stable tree
[email protected]
AppliedThis is a note to let you know that I've just added the patch titled
tools build: Switch to new openssl API for test-libcrypto
to the 5.19-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
tools-build-switch-to-new-openssl-api-for-test-libcrypto.patch
and it can be found in the queue-5.19 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From 5b245985a6de5ac18b5088c37068816d413fb8ed Mon Sep 17 00:00:00 2001
From: Roberto Sassu <[email protected]>
Date: Tue, 19 Jul 2022 19:05:55 +0200
Subject: tools build: Switch to new openssl API for test-libcrypto
From: Roberto Sassu <[email protected]>
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.
--- tools/build/feature/test-libcrypto.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
tools/build/feature/test-libcrypto.c +11 -4
@@ -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 ]);
Patches currently in stable-queue which might be from [email protected] are
queue-5.19/tools-build-switch-to-new-openssl-api-for-test-libcrypto.patch