summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJihoon Jung <jh8801.jung@samsung.com>2019-06-14 11:06:07 +0900
committerJihoon Jung <jh8801.jung@samsung.com>2019-06-14 11:06:07 +0900
commitc076e8d007dd4ddb55925009fea3b7484feab1f0 (patch)
tree9a4399664043e917bcc80941b8787be600c381ad
parent08dd3b5942803d8df105b07eea6a716a4cdccdb9 (diff)
downloadsmartcard-service-tizen_5.5_tv.tar.gz
smartcard-service-tizen_5.5_tv.tar.bz2
smartcard-service-tizen_5.5_tv.zip
Change-Id: If9016adc7e0bb552f8172991a5e996e29742754c Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
-rw-r--r--common/CMakeLists.txt2
-rw-r--r--common/OpensslHelper.cpp18
-rwxr-xr-xpackaging/smartcard-service.spec3
3 files changed, 20 insertions, 3 deletions
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index 224e6bc..8677f14 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -15,7 +15,7 @@ AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SRCS)
#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}")
diff --git a/common/OpensslHelper.cpp b/common/OpensslHelper.cpp
index d71ab25..c34d657 100644
--- a/common/OpensslHelper.cpp
+++ b/common/OpensslHelper.cpp
@@ -144,20 +144,38 @@ namespace smartcard_service_api
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);
}
diff --git a/packaging/smartcard-service.spec b/packaging/smartcard-service.spec
index ec62fb9..ab1a2e2 100755
--- a/packaging/smartcard-service.spec
+++ b/packaging/smartcard-service.spec
@@ -10,8 +10,7 @@ BuildRequires: pkgconfig(glib-2.0)
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)