[KeyManager] Check if password is not null.
authorTomasz Marciniak <t.marciniak@samsung.com>
Fri, 3 Jul 2015 11:08:30 +0000 (13:08 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Tue, 7 Jul 2015 06:47:18 +0000 (15:47 +0900)
[Verification] Code compiles without errors.

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

index 75fc360..6dcb648 100755 (executable)
@@ -288,7 +288,10 @@ void KeyManagerInstance::GetKey(const picojson::value& args,
     picojson::object result;
 
     result["name"] = picojson::value(key_alias);
-    result["password"] = picojson::value(key->password);
+    if (key->password) {
+      result["password"] = picojson::value(key->password);
+    }
+
     // if key was retrieved it is extractable from DB
     result["extractable"] = picojson::value(true);
     result["keyType"] = picojson::value(KeyTypeToString(key->key_type));