Name: crash-worker
Summary: Coredump handler and report generator for Tizen
-Version: 7.0.1
+Version: 8.0.0
Release: 1
Group: Framework/system
License: MIT
BuildRequires: pkgconfig(libunwind-generic)
BuildRequires: libcap-devel
BuildRequires: pkgconfig(json-c)
-BuildRequires: pkgconfig(openssl1.1)
+BuildRequires: pkgconfig(openssl3)
BuildRequires: pkgconfig(diagnostics)
BuildRequires: pkgconfig(bugreport)
%if %{with dumpsystemstateservice}
iniparser
pkgmgr-info
rpm
- libcrypto1.1
+ libcrypto3
diagnostics
)
#include "shared/util.h"
#include <tzplatform_config.h>
#include <openssl/sha.h>
+#include <openssl/evp.h>
#define BID_SNAME ".note.gnu.build-id"
return false;
}
- SHA_CTX context;
- if (SHA1_Init(&context) == 0) {
+ EVP_MD_CTX *ctx = EVP_MD_CTX_create();
+ const EVP_MD *md = EVP_sha1();
+
+ if (EVP_DigestInit_ex(ctx, md, NULL) == 0) {
_E("Failed to initialize SHA1 context for: %s", filename);
goto exit;
}
goto exit;
}
- if (SHA1_Update(&context, buff, bytes) == 0) {
+ if (EVP_DigestUpdate(ctx, buff, bytes) == 0) {
_E("Failed to update SHA1 hash sum for: %s", filename);
goto exit;
}
} while (bytes > 0);
unsigned char hash[SHA_DIGEST_LENGTH];
- if (SHA1_Final(hash, &context) == 0) {
+ if (EVP_DigestFinal(ctx, hash, 0) == 0) {
_E("Failed to compute the SHA1 hash sum for: %s", filename);
goto exit;
}
result = true;
exit:
+ EVP_MD_CTX_destroy(ctx);
close(fd);
return result;
}
pkg_check_modules(LIBUNWIND REQUIRED libunwind-generic)
pkg_check_modules(DLOG REQUIRED dlog)
pkg_check_modules(JSON REQUIRED json-c)
-pkg_check_modules(LIBCRYPTO REQUIRED libcrypto1.1)
+pkg_check_modules(LIBCRYPTO REQUIRED libcrypto3)
set_property(TARGET ${CRASH_STACK_BIN} APPEND_STRING PROPERTY COMPILE_FLAGS "${JSON_CFLAGS} ${LIBUNWIND_CFLAGS} ${DLOG_CFLAGS} ${LIBCRYPTO_CFLAGS}")
# Linking
#include <limits.h>
#include <linux/prctl.h>
#include <openssl/sha.h>
+#include <openssl/evp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
assert(callstack);
assert(maps);
- SHA256_CTX hash_ctx;
- SHA256_Init(&hash_ctx);
+ EVP_MD_CTX *ctx = EVP_MD_CTX_create();
+ const EVP_MD *md = EVP_sha256();
+ EVP_DigestInit_ex(ctx, md, NULL);
for (size_t i = 0; i < callstack->elems; i++) {
// We won't be able to substract the start address so we skip
continue;
}
uintptr_t addr = callstack->proc[i].addr + callstack->proc[i].module_offset - m_node->startaddr;
- SHA256_Update(&hash_ctx, &addr, sizeof(addr));
+ EVP_DigestUpdate(ctx, &addr, sizeof(addr));
}
unsigned char hash[SHA256_DIGEST_LENGTH];
- SHA256_Final(hash, &hash_ctx);
+ EVP_DigestFinal_ex(ctx, hash, 0);
+ EVP_MD_CTX_destroy(ctx);
char hash_str[SHA256_DIGEST_LENGTH*2+1];