summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>2018-10-05 16:17:44 +0200
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>2018-10-08 07:18:17 +0000
commit7d81f2d157e4f2f2d1aae5f1e327a1bb073da82b (patch)
tree9b9bf4f670fafffd4afece6d58cfc75e06f4596f
parent3195a9624186ca5b6b681148b192e9ef48cfe872 (diff)
downloadkey-manager-7d81f2d157e4f2f2d1aae5f1e327a1bb073da82b.tar.gz
key-manager-7d81f2d157e4f2f2d1aae5f1e327a1bb073da82b.tar.bz2
key-manager-7d81f2d157e4f2f2d1aae5f1e327a1bb073da82b.zip
Overwrite existing initial values
Delete any existing values of given name before saving new one. Change-Id: I4cf23efad7cff6ef453f1ed7e4bfcda76d2fdc69
-rw-r--r--src/manager/initial-values/InitialValueHandler.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/manager/initial-values/InitialValueHandler.cpp b/src/manager/initial-values/InitialValueHandler.cpp
index 6ca335a..ef06c1a 100644
--- a/src/manager/initial-values/InitialValueHandler.cpp
+++ b/src/manager/initial-values/InitialValueHandler.cpp
@@ -78,6 +78,9 @@ void InitialValueHandler::End()
// save data
Policy policy(m_password, m_exportable, m_backend);
+ m_db_logic.removeData(Credentials(CKMLogic::SYSTEM_DB_UID, CLIENT_ID_SYSTEM),
+ 0, m_name, CLIENT_ID_SYSTEM);
+
int ec = m_db_logic.importInitialData(m_name,
Crypto::Data(getDataType(), m_bufferHandler->getData()),
m_bufferHandler->getEncryptionParams(),