[KeyManager] Added logs when enter to the functions.
authorTomasz Marciniak <t.marciniak@samsung.com>
Fri, 3 Jul 2015 09:15:08 +0000 (11:15 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Tue, 7 Jul 2015 06:46:54 +0000 (15:46 +0900)
[Verification] Code compiles without errors.

Change-Id: Ib189190ab21fe2725dddf50545e37102818f15e7
Signed-off-by: Tomasz Marciniak <t.marciniak@samsung.com>
src/keymanager/keymanager_instance.cc

index dcd135a8789730c0db8da5f99cfedd771d5c2037..75fc360baab5340f41fe45904f1b39ce78d43806 100755 (executable)
@@ -341,12 +341,14 @@ void KeyManagerInstance::SaveKey(const picojson::value& args,
   auto save = [alias, pass, key_type, extractable, raw_buffer]
                (const std::shared_ptr<picojson::value>& response) -> void {
 
+    LoggerD("Enter save_key");
     ckmc_policy_s policy { const_cast<char*>(pass.c_str()), extractable };
     ckmc_key_s key { const_cast<unsigned char*>(&(*raw_buffer)[0]),
       raw_buffer->size(), key_type, const_cast<char*>(pass.c_str()) };
 
     int ret = ckmc_save_key(alias.c_str(), key, policy);
     if (CKMC_ERROR_NONE != ret) {
+      LoggerE("Failed to save key alias [%d]", ret);
       PlatformResult result = PlatformResult(ErrorCode::NO_ERROR);
       if (CKMC_ERROR_INVALID_PARAMETER == ret) {
         result = PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid parameter passed.");
@@ -362,6 +364,7 @@ void KeyManagerInstance::SaveKey(const picojson::value& args,
   };
 
   auto save_response = [this, callback_id](const std::shared_ptr<picojson::value>& response) -> void {
+    LoggerD("Enter save_key_result");
     picojson::object& obj = response->get<picojson::object>();
     obj.insert(std::make_pair("callbackId", picojson::value(callback_id)));
     this->PostMessage(response->serialize().c_str());
@@ -381,6 +384,7 @@ void KeyManagerInstance::RemoveAlias(const picojson::value& args,
   int ret = ckmc_remove_alias(alias.c_str());
 
   if (CKMC_ERROR_NONE != ret) {
+    LoggerE("Failed to remove alias [%d]", ret);
     PlatformResult result = PlatformResult(ErrorCode::NO_ERROR);
     switch(ret) {
       case CKMC_ERROR_INVALID_PARAMETER: