Change CA certificate bundle and path for TV 29/225129/1
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 17 Feb 2020 08:50:11 +0000 (17:50 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 17 Feb 2020 12:11:40 +0000 (21:11 +0900)
Change-Id: I2029019f151df781ed589646e0b9ed69077f80fa

agent/CMakeLists.txt
agent/download-agent-plugin-libcurl.c
packaging/download-provider.spec

index 718f080..1808dcc 100755 (executable)
@@ -80,6 +80,16 @@ IF(SUPPORT_LARGE_FILE)
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -D_FILE_OFFSET_BITS=64")
 ENDIF(SUPPORT_LARGE_FILE)
 
+IF(CA_CERT)
+       MESSAGE("CA_CERT:${CA_CERT}")
+       ADD_DEFINITIONS(-D_CA_CERT="${CA_CERT}")
+ENDIF(CA_CERT)
+
+IF(CA_PATH)
+       MESSAGE("CA_PATH:${CA_PATH}")
+       ADD_DEFINITIONS(-D_CA_PATH="${CA_PATH}")
+ENDIF(CA_PATH)
+
 FOREACH(flag ${subpkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
index f28949e..8c7ddc1 100755 (executable)
@@ -509,6 +509,12 @@ da_ret_t PI_http_start(da_info_t *da_info)
        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, err_buffer);
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
+#ifdef _CA_CERT
+       curl_easy_setopt(curl, CURLOPT_CAINFO, _CA_CERT);
+#endif
+#ifdef _CA_PATH
+       curl_easy_setopt(curl, CURLOPT_CAPATH, _CA_PATH);
+#endif
 #ifdef _RAF_SUPPORT
        curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, __http_progress_cb);
        curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, da_info);
index d380bff..49c1294 100755 (executable)
@@ -65,6 +65,10 @@ Description: Download the contents in background (development files)
 %define _logdump_script_dir %{TZ_SYS_ETC}/dump.d/module.d
 %define _http_lib libcurl
 %define _manifest_name %{name}.manifest
+%if "%{?tizen_profile_name}" == "tv"
+%define _ca_cert /opt/data/cert/vdca.pem
+%define _ca_path /opt/data/cert/user/
+%endif
 
 %build
 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
@@ -122,6 +126,8 @@ export LDFLAGS+=" -lgcov"
        -DSUPPORT_LARGE_FILE:BOOL=ON \
 %if "%{?tizen_profile_name}" == "tv"
        -DUSE_SSL_THREAD_LOCKING:BOOL=ON \
+       -DCA_CERT=%{_ca_cert} \
+       -DCA_PATH=%{_ca_path} \
 %endif
        .