diff --git a/tools/replay/SConscript b/tools/replay/SConscript index 136c4119f64464..35fd4831925b8e 100644 --- a/tools/replay/SConscript +++ b/tools/replay/SConscript @@ -1,10 +1,9 @@ Import('env', 'arch', 'common', 'messaging', 'visionipc', 'cereal') replay_env = env.Clone() -replay_env['CCFLAGS'] += ['-Wno-deprecated-declarations'] base_frameworks = [] -base_libs = [common, messaging, cereal, visionipc, 'm', 'ssl', 'crypto', 'pthread'] +base_libs = [common, messaging, cereal, visionipc, 'crypto', 'pthread'] if arch == "Darwin": base_frameworks.append('OpenCL') diff --git a/tools/replay/util.cc b/tools/replay/util.cc index 94cea961ffc6fb..f128cf7806d5bc 100644 --- a/tools/replay/util.cc +++ b/tools/replay/util.cc @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -383,10 +384,16 @@ void precise_nano_sleep(int64_t nanoseconds, std::atomic &interrupt_reques std::string sha256(const std::string &str) { unsigned char hash[SHA256_DIGEST_LENGTH]; - SHA256_CTX sha256; - SHA256_Init(&sha256); - SHA256_Update(&sha256, str.c_str(), str.size()); - SHA256_Final(hash, &sha256); + EVP_MD_CTX *mdctx = EVP_MD_CTX_new(); + if (mdctx == nullptr) return ""; + + if (EVP_DigestInit_ex(mdctx, EVP_sha256(), nullptr) != 1 || + EVP_DigestUpdate(mdctx, str.c_str(), str.size()) != 1 || + EVP_DigestFinal_ex(mdctx, hash, nullptr) != 1) { + EVP_MD_CTX_free(mdctx); + return ""; + } + EVP_MD_CTX_free(mdctx); return util::hexdump(hash, SHA256_DIGEST_LENGTH); }