#MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs_common REQUIRED glib-2.0 gio-unix-2.0 dlog aul libssl libcrypto pkgmgr pkgmgr-info)
+pkg_check_modules(pkgs_common REQUIRED glib-2.0 gio-unix-2.0 dlog aul openssl1.1 pkgmgr pkgmgr-info)
MESSAGE("${LIB_NAME} ld flag : ${pkgs_common_LDFLAGS}")
if ((md = EVP_get_digestbyname(algorithm)) != NULL) {
uint8_t temp[EVP_MAX_MD_SIZE] = { 0, };
+#if OPENSSL_VERSION_NUMBER < 0x10100000L // OpenSSL 1.0.2
EVP_MD_CTX mdCtx;
+#else // OpenSSL 1.1.1
+ EVP_MD_CTX *mdCtx;
+ mdCtx = EVP_MD_CTX_new();
+#endif
unsigned int resultLen = 0;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L // OpenSSL 1.0.2
if (EVP_DigestInit(&mdCtx, md) > 0) {
if (EVP_DigestUpdate(&mdCtx, buffer.getBuffer(), buffer.size()) == 0) {
+#else // OpenSSL 1.1.1
+ if (EVP_DigestInit(mdCtx, md) > 0) {
+ if (EVP_DigestUpdate(mdCtx, buffer.getBuffer(), buffer.size()) == 0) {
+#endif
_ERR("EVP_DigestUpdate failed");
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L // OpenSSL 1.0.2
if (EVP_DigestFinal(&mdCtx, temp, &resultLen) > 0 &&
resultLen > 0) {
+#else // OpenSSL 1.1.1
+ if (EVP_DigestFinal(mdCtx, temp, &resultLen) > 0 &&
+ resultLen > 0) {
+#endif
result.assign(temp, resultLen);
ret = true;
}
}
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L // OpenSSL 1.1.1
+ EVP_MD_CTX_free(mdCtx);
+#endif
} else {
_ERR("EVP_get_digestbyname(\"%s\") returns NULL", algorithm);
}
BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(aul)
-BuildRequires: pkgconfig(libssl)
-BuildRequires: pkgconfig(libcrypto)
+BuildRequires: pkgconfig(openssl1.1)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(cynara-client)