Verify that EVP_sm3 is enabled. (#6605)

This commit is contained in:
Giovanni 2026-07-06 18:27:24 +08:00 committed by GitHub
parent 155ead6822
commit 6f2989f0ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 3 deletions

View file

@ -4,7 +4,7 @@
#include <rz_hash.h>
#include <rz_util/rz_assert.h>
#if HAVE_LIB_SSL
#if HAVE_LIB_SSL && HAVE_LIB_SSL_SM3
/**
* Use OpenSSL lib, not the Rizin implementation
*/
@ -12,7 +12,7 @@
#include "../algorithms/openssl_common.h"
rz_openssl_plugin_define_hash_cfg(sm3, EVP_sm3, true);
#else /* HAVE_LIB_SSL */
#else /* HAVE_LIB_SSL && HAVE_LIB_SSL_SM3 */
/**
* Use Rizin implementation, not OpenSSL lib
*/

View file

@ -37,6 +37,7 @@
#define USE_LIB_XXHASH @USE_LIB_XXHASH@
#define USE_SYS_ZYDIS @USE_SYS_ZYDIS@
#define HAVE_LIB_SSL @HAVE_OPENSSL@
#define HAVE_LIB_SSL_SM3 @HAVE_OPENSSL_SM3@
#define HAVE_PTRACE @HAVE_PTRACE@
#define USE_PTRACE_WRAP @USE_PTRACE_WRAP@
#define HAVE_FORK @HAVE_FORK@

View file

@ -483,7 +483,14 @@ foreach it : ccs
it_userconf.set('HUD', rizin_hud)
it_userconf.set('PLUGINS', rizin_plugins)
it_userconf.set('BINDINGS', rizin_bindings)
it_userconf.set10('HAVE_OPENSSL', sys_openssl.found())
if sys_openssl.found()
it_userconf.set10('HAVE_OPENSSL', true)
ok = it_cc.has_function('EVP_sm3', prefix: '#include <openssl/evp.h>', dependencies: [sys_openssl])
it_userconf.set10('HAVE_OPENSSL_SM3', ok)
else
it_userconf.set10('HAVE_OPENSSL', false)
it_userconf.set10('HAVE_OPENSSL_SM3', false)
endif
it_userconf.set10('WANT_DYLINK', true)
it_userconf.set10('HAVE_PTRACE', have_ptrace)
it_userconf.set10('USE_PTRACE_WRAP', use_ptrace_wrap)