add the checking routine of app-id for secure key 49/68949/6 accepted/tizen/common/20160511.142148 accepted/tizen/ivi/20160512.050843 accepted/tizen/mobile/20160512.050841 accepted/tizen/tv/20160512.050813 accepted/tizen/wearable/20160512.050831 submit/tizen/20160511.042603
authorjongmun.woo <jongmun.woo@samsung.com>
Tue, 10 May 2016 12:59:35 +0000 (21:59 +0900)
committerjongmun.woo <jongmun.woo@samsung.com>
Wed, 11 May 2016 03:24:20 +0000 (12:24 +0900)
Signed-off-by: jongmun.woo <jongmun.woo@samsung.com>
Change-Id: I5fff8caa9a7b8626bdde0f4f5191887f98aec827

15 files changed:
inc/engine/common/ApplicationContext.h
inc/engine/common/BaseQuery.h
lib/aarch64/libheremaps-engine.so.1
lib/aarch64/libheremaps-engine.so.1.0.6_12 [deleted file]
lib/aarch64/libheremaps-engine.so.1.0.6_13 [new file with mode: 0644]
lib/arm/libheremaps-engine.so.1
lib/arm/libheremaps-engine.so.1.0.6_12 [deleted file]
lib/arm/libheremaps-engine.so.1.0.6_13 [new file with mode: 0644]
lib/i586/libheremaps-engine.so.1
lib/i586/libheremaps-engine.so.1.0.6_12 [deleted file]
lib/i586/libheremaps-engine.so.1.0.6_13 [new file with mode: 0644]
lib/x86_64/libheremaps-engine.so.1
lib/x86_64/libheremaps-engine.so.1.0.6_12 [deleted file]
lib/x86_64/libheremaps-engine.so.1.0.6_13 [new file with mode: 0644]
src/here_manager.cpp

index d19dd9592985ee9638635dcf3d9a7be28a00d3a5..4f4fa6ba1e8e344276044cb3912c5dd7f0b6850d 100755 (executable)
@@ -58,18 +58,25 @@ public:
 
     /**
      * This method retrieves the app code.
-     * 
-     * @return A constant reference to a string containing the app code. 
+     *
+     * @return A constant reference to a string containing the app code.
      */
     const String& GetAppCode() const;
 
     /**
      * This method retrieves the app id.
-     * 
-     * @return A constant reference to a string containing the app id. 
+     *
+     * @return A constant reference to a string containing the app id.
      */
     const String& GetAppId() const;
 
+    /**
+     * This method retrieves the request app id.
+     *
+     * @return A constant reference to a string containing the request app id.
+     */
+    const String& GetRequestAppId() const;
+
     /**
      * This is a static method which returns the singleton's instance.
      *
@@ -84,13 +91,15 @@ public:
      *
      * @param sAppId A constant reference to a string containing the app id.
      *
+     * @param sRequestAppId A constant reference to a string containing the request app id.
+     *
      * @return A Boolean indicating the result of initialization,
      *        <code>true</code> on success, <code>false</code> on failure. Note
      *        that if the object already exists and has been initialized,
      *        further attempts to call this methods fail (the return value is
      *        <code>false</code>.
      */
-    bool Initialize(const String& sAppCode, const String& sAppId);
+    bool Initialize(const String& sAppCode, const String& sAppId, const String& sRequestAppId = "");
 
     /**
      * This method queries initialisation status.
index 3123bd77803118401beea288d48455e760d36166..3e5098707f0d13a5a77c058a75f00bb98220ad5f 100755 (executable)
@@ -61,6 +61,11 @@ protected:
      */
     static const String ILLEGAL_URL;
 
+    /**
+     * This constant represents an App ID.
+     */
+    String RequestAppId;
+
     /**
      * This is the default constructor.
      */
index 0f3e16b474c7cc674b671ed9b52f640caef64972..87c6e3c930c8a6bb3c101ac7078d85a831e08cc9 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_12
\ No newline at end of file
+libheremaps-engine.so.1.0.6_13
\ No newline at end of file
diff --git a/lib/aarch64/libheremaps-engine.so.1.0.6_12 b/lib/aarch64/libheremaps-engine.so.1.0.6_12
deleted file mode 100755 (executable)
index e34a904..0000000
Binary files a/lib/aarch64/libheremaps-engine.so.1.0.6_12 and /dev/null differ
diff --git a/lib/aarch64/libheremaps-engine.so.1.0.6_13 b/lib/aarch64/libheremaps-engine.so.1.0.6_13
new file mode 100644 (file)
index 0000000..c50cc19
Binary files /dev/null and b/lib/aarch64/libheremaps-engine.so.1.0.6_13 differ
index 0f3e16b474c7cc674b671ed9b52f640caef64972..87c6e3c930c8a6bb3c101ac7078d85a831e08cc9 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_12
\ No newline at end of file
+libheremaps-engine.so.1.0.6_13
\ No newline at end of file
diff --git a/lib/arm/libheremaps-engine.so.1.0.6_12 b/lib/arm/libheremaps-engine.so.1.0.6_12
deleted file mode 100755 (executable)
index 2f011ed..0000000
Binary files a/lib/arm/libheremaps-engine.so.1.0.6_12 and /dev/null differ
diff --git a/lib/arm/libheremaps-engine.so.1.0.6_13 b/lib/arm/libheremaps-engine.so.1.0.6_13
new file mode 100644 (file)
index 0000000..7329a8a
Binary files /dev/null and b/lib/arm/libheremaps-engine.so.1.0.6_13 differ
index 0f3e16b474c7cc674b671ed9b52f640caef64972..87c6e3c930c8a6bb3c101ac7078d85a831e08cc9 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_12
\ No newline at end of file
+libheremaps-engine.so.1.0.6_13
\ No newline at end of file
diff --git a/lib/i586/libheremaps-engine.so.1.0.6_12 b/lib/i586/libheremaps-engine.so.1.0.6_12
deleted file mode 100755 (executable)
index 1d587a9..0000000
Binary files a/lib/i586/libheremaps-engine.so.1.0.6_12 and /dev/null differ
diff --git a/lib/i586/libheremaps-engine.so.1.0.6_13 b/lib/i586/libheremaps-engine.so.1.0.6_13
new file mode 100644 (file)
index 0000000..135a916
Binary files /dev/null and b/lib/i586/libheremaps-engine.so.1.0.6_13 differ
index 0f3e16b474c7cc674b671ed9b52f640caef64972..87c6e3c930c8a6bb3c101ac7078d85a831e08cc9 120000 (symlink)
@@ -1 +1 @@
-libheremaps-engine.so.1.0.6_12
\ No newline at end of file
+libheremaps-engine.so.1.0.6_13
\ No newline at end of file
diff --git a/lib/x86_64/libheremaps-engine.so.1.0.6_12 b/lib/x86_64/libheremaps-engine.so.1.0.6_12
deleted file mode 100755 (executable)
index 9eef082..0000000
Binary files a/lib/x86_64/libheremaps-engine.so.1.0.6_12 and /dev/null differ
diff --git a/lib/x86_64/libheremaps-engine.so.1.0.6_13 b/lib/x86_64/libheremaps-engine.so.1.0.6_13
new file mode 100644 (file)
index 0000000..4d4c694
Binary files /dev/null and b/lib/x86_64/libheremaps-engine.so.1.0.6_13 differ
index e99dd782a150f168a7c145101dc6305cd5e0d018..02e06d851391d355586e92e99e3e562ac0958c12 100644 (file)
@@ -261,7 +261,7 @@ here_error_e HereManager::SetCredentials(const char *szKey)
                return HERE_ERROR_INVALID_PARAMETER;
 
        String strKey(szKey);
-       String strAppId, strAppCode;
+       String strAppId, strAppCode, strRequestAppId = "";
        size_t nCodeStart;
 
        nCodeStart = strKey.find("/");
@@ -275,7 +275,20 @@ here_error_e HereManager::SetCredentials(const char *szKey)
        strAppId = strKey.substr(0, nCodeStart);
        strAppCode = strKey.substr(nCodeStart+1, std::string::npos);
 
-       if(!ApplicationContext::GetInstance().Initialize(strAppCode, strAppId))
+       if (ApplicationContext::GetInstance().GetRequestAppId().length() < 1) {
+               char *strAppId = NULL;
+               pid_t nProcessId = getpid();
+
+               app_manager_get_app_id(nProcessId, &strAppId);
+               if (strAppId != NULL) {
+                       MAPS_LOGE("RequestAppId is %s", strAppId);
+                       strRequestAppId.append(strAppId);
+                       g_free(strAppId);
+               }
+       } else
+               strRequestAppId = ApplicationContext::GetInstance().GetRequestAppId();
+
+       if(!ApplicationContext::GetInstance().Initialize(strAppCode, strAppId, strRequestAppId))
                return HERE_ERROR_INVALID_OPERATION;
 
        //MAPS_LOGD("[success] credential setted to 'XXXXX/XXXXX'");