remove drm_trusted
authorSeunghwan Lee <sh.cat.lee@samsung.com>
Thu, 23 Aug 2012 08:02:17 +0000 (17:02 +0900)
committerSeunghwan Lee <sh.cat.lee@samsung.com>
Thu, 23 Aug 2012 08:02:17 +0000 (17:02 +0900)
packaging/msg-service.spec
utils/CMakeLists.txt
utils/MsgDrmWrapper.cpp

index 2323e92..3955bab 100755 (executable)
@@ -19,7 +19,6 @@ BuildRequires: pkgconfig(db-util)
 BuildRequires: pkgconfig(devman_haptic)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(drm-client)
-BuildRequires: pkgconfig(drm-trusted)
 BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(libcurl)
 BuildRequires: pkgconfig(libsystemd-daemon)
index 8cf91be..3fcb101 100755 (executable)
@@ -41,7 +41,7 @@ INCLUDE_DIRECTORIES(
 )
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(utils_pkgs REQUIRED glib-2.0 vconf db-util contacts-service dlog pmapi mm-session alarm-service notification phone-misc drm-client drm-trusted)
+pkg_check_modules(utils_pkgs REQUIRED glib-2.0 vconf db-util contacts-service dlog pmapi mm-session alarm-service notification phone-misc drm-client)
 
 FOREACH(flag ${utils_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 7e0b88b..248738d 100755 (executable)
@@ -32,8 +32,6 @@
 #include <errno.h>
 #include <drm_client_types.h>
 #include <drm_client.h>
-#include <drm_trusted_client_types.h>
-#include <drm_trusted_client.h>
 
 #define MSG_MAX_DRM_FILE_PATH MSG_FILEPATH_LEN_MAX
 
@@ -106,123 +104,6 @@ bool MsgDrmIsDrmFile(const char *szFilePath)
 /*Added to convert the .dm files in to .dcf files since our platform supports only .dcf :: Start*/
 bool MsgDrmConvertDmtoDcfType(char *inputFile, char *outputFile)
 {
-       if ((NULL == inputFile) || (NULL == outputFile)) {
-               MSG_DEBUG("Invalid Input parameters");
-               return false;
-       }
-
-       if (strstr(inputFile, ".dm")) {
-               MSG_DEBUG("Current File extension is .dm %s", inputFile);
-               int ret;
-
-               FILE *fp = MsgOpenFile(inputFile, "rb");//Check fp
-
-               if (fp == NULL) {
-                       MSG_DEBUG("[File Open Fail(Errno=%d)][ErrStr=%s]", errno, strerror(errno));
-                       strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH);
-                       return false;
-               }
-
-               if (MsgFseek(fp, 0L, SEEK_END) < 0) {
-                       MsgCloseFile(fp);
-                       MSG_DEBUG("MsgFseek() returns negative value!!!");
-                       return false;
-               }
-               long retVal = MsgFtell(fp);
-
-               if (retVal < 0) {
-                       MsgCloseFile(fp);
-                       MSG_DEBUG("ftell() returns negative value: [%ld]!!!", retVal);
-                       strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH);
-                       return false;
-               }
-
-               unsigned long bufLen = retVal;
-               MSG_DEBUG("fopen buffer len = %d", bufLen);
-               if (MsgFseek(fp, 0, SEEK_SET) < 0) {
-                       MsgCloseFile(fp);
-                       MSG_DEBUG("MsgFseek() returns negative value!!!");
-                       return false;
-               }
-
-               unsigned char *buffer = (unsigned char*)malloc(bufLen);
-               int readed_size = 0;
-               int pathLen = strlen(inputFile);
-
-               if (buffer == NULL) {
-                       MsgCloseFile(fp);
-                       MSG_DEBUG("malloc is failed ");
-                       strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH);
-                       return false;
-               }
-
-               strncpy(outputFile, inputFile, pathLen - 2);
-               strncat(outputFile, "dcf", 3);
-
-               readed_size = MsgReadFile(buffer, 1, bufLen, fp);//Check for error
-               MSG_DEBUG("fread read size = %d", readed_size);
-               if (readed_size == 0) {
-                       MsgCloseFile(fp);
-                       free(buffer);
-                       MSG_DEBUG("MsgReadFile returns 0");
-                       return false;
-               }
-
-               DRM_TRUSTED_CONVERT_HANDLE hConvert = NULL;
-               drm_trusted_opn_conv_info_s trusted_open_conv_input;
-               bzero(&trusted_open_conv_input, sizeof(drm_trusted_opn_conv_info_s));
-
-               strncpy(trusted_open_conv_input.filePath, outputFile, DRM_TRUSTED_MAX_FILEPATH_LEN-1);
-               trusted_open_conv_input.install_RO = DRM_TRUSTED_TRUE;
-
-               ret = drm_trusted_open_convert(&trusted_open_conv_input, &hConvert);
-               if (ret != DRM_RETURN_SUCCESS) {
-                       free(buffer);
-                       MsgCloseFile(fp);
-                       MSG_DEBUG("drm_trusted_open_convert() return = failed (%d)", ret);
-                       strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH);
-                       return false;
-               }
-
-               drm_trusted_write_conv_info_s trusted_write_conv_input;
-               drm_trusted_write_conv_resp_s trusted_write_conv_output;
-
-               bzero(&trusted_write_conv_input, sizeof(drm_trusted_write_conv_info_s));
-               bzero(&trusted_write_conv_output, sizeof(drm_trusted_write_conv_resp_s));
-
-               trusted_write_conv_input.data = buffer;
-               trusted_write_conv_input.data_len = bufLen;
-
-               /*We can call drm_trusted_write_convert in loop if file size is large*/
-               ret = drm_trusted_write_convert(&trusted_write_conv_input, &trusted_write_conv_output, hConvert);
-               if (ret != DRM_RETURN_SUCCESS) {
-                       free(buffer);
-                       MsgCloseFile(fp);
-                       MSG_DEBUG("drm_trusted_write_convert() return = failed (%d)", ret);
-                       strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH);
-                       return false;
-               }
-
-               ret = drm_trusted_close_convert(&hConvert);
-               if (ret != DRM_RETURN_SUCCESS) {
-                       free(buffer);
-                       MsgCloseFile(fp);
-                       MSG_DEBUG("drm_trusted_close_convert() return = failed (%d)", ret);
-                       strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH);
-                       return false;
-               }
-
-               MsgCloseFile(fp);
-               free(buffer);
-       } else {
-               MSG_DEBUG("Current File extension is not .dm");
-
-               MSG_DEBUG("inputFile = (%s)", inputFile);
-               strncpy(outputFile, inputFile, MSG_MAX_DRM_FILE_PATH);
-
-               return false;
-       }
-
        return true;
 }