Rename KEY_MANAGER_API_ERROR_DB_BAD_REQUEST.
authorBartlomiej Grzelewski <b.grzelewski@samsung.com>
Mon, 23 Jun 2014 13:59:47 +0000 (15:59 +0200)
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>
Fri, 12 Sep 2014 12:58:32 +0000 (14:58 +0200)
New name is KEY_MANAGER_API_ERROR_DB_ALIAS_UNKNOWN

Change-Id: Iad75fa44e19dfcf62f5ee9a647e9cd8963189f93

src/include/ckm/ckm-error.h
src/manager/client/client-error.cpp
src/manager/service/ckm-logic.cpp
src/manager/service/db-crypto.cpp

index 89877df..63bd285 100644 (file)
 /*! \brief   indicating the database was not unlocked - user did not login */
 #define KEY_MANAGER_API_ERROR_DB_LOCKED -12
 
-/*! \brief   indicating that request give to database returned no result */
-#define KEY_MANAGER_API_ERROR_DB_BAD_REQUEST -13
-
 /*! \brief   indicating an internal error inside the database */
-#define KEY_MANAGER_API_ERROR_DB_ERROR -14
+#define KEY_MANAGER_API_ERROR_DB_ERROR -13
 
 /*! \brief   indicating that provided alias already exists in the database */
-#define KEY_MANAGER_API_ERROR_DB_ALIAS_EXISTS -15
+#define KEY_MANAGER_API_ERROR_DB_ALIAS_EXISTS -14
+
+/*! \brief   indicating that request give to database returned no result */
+#define KEY_MANAGER_API_ERROR_DB_ALIAS_UNKNOWN -15
 
 /*! \brief   indicating the error with unknown reason */
 #define KEY_MANAGER_API_ERROR_UNKNOWN -255
index 3a74c20..3f846ed 100644 (file)
@@ -39,9 +39,9 @@ const char * ErrorToString(int error) {
         ERRORDESCRIBE(KEY_MANAGER_API_ERROR_ACCESS_DENIED);
         ERRORDESCRIBE(KEY_MANAGER_API_ERROR_SERVER_ERROR);
         ERRORDESCRIBE(KEY_MANAGER_API_ERROR_DB_LOCKED);
-        ERRORDESCRIBE(KEY_MANAGER_API_ERROR_DB_BAD_REQUEST);
         ERRORDESCRIBE(KEY_MANAGER_API_ERROR_DB_ERROR);
         ERRORDESCRIBE(KEY_MANAGER_API_ERROR_DB_ALIAS_EXISTS);
+        ERRORDESCRIBE(KEY_MANAGER_API_ERROR_DB_ALIAS_UNKNOWN);
         ERRORDESCRIBE(KEY_MANAGER_API_ERROR_UNKNOWN);
     default:
         return "Error not defined";
index 15ef37a..3b933fe 100644 (file)
@@ -154,7 +154,7 @@ int CKMLogic::saveDataHelper(
     if (!handler.crypto.haveKey(cred.smackLabel)) {
         RawBuffer key;
         int status = handler.database.getKey(cred.smackLabel, key);
-        if (KEY_MANAGER_API_ERROR_DB_BAD_REQUEST == status) {
+        if (KEY_MANAGER_API_ERROR_DB_ALIAS_UNKNOWN == status) {
             LogDebug("No Key in database found. Generating new one for label: " << cred.smackLabel);
             key = handler.keyProvider.generateDEK(cred.smackLabel);
             if (KEY_MANAGER_API_SUCCESS != handler.database.saveKey(cred.smackLabel, key)) {
index 3077489..21a12c1 100644 (file)
@@ -286,7 +286,7 @@ using namespace DB;
         if(selectCommand->Step()) {
             row = getRow(selectCommand);
         } else {
-            return KEY_MANAGER_API_ERROR_DB_BAD_REQUEST;
+            return KEY_MANAGER_API_ERROR_DB_ALIAS_UNKNOWN;
         }
 
         AssertMsg(!selectCommand->Step(),
@@ -321,7 +321,7 @@ using namespace DB;
             if(selectCommand->Step()){
                 row = getRow(selectCommand);
             } else {
-                return KEY_MANAGER_API_ERROR_DB_BAD_REQUEST;
+                return KEY_MANAGER_API_ERROR_DB_ALIAS_UNKNOWN;
             }
         } Catch (SqlConnection::Exception::InvalidColumn) {
             LogError("Select statement invalid column error");
@@ -470,7 +470,7 @@ using namespace DB;
             if (selectCommand->Step()) {
                 key = selectCommand->GetColumnBlob(0);
             } else {
-                return KEY_MANAGER_API_ERROR_DB_BAD_REQUEST;
+                return KEY_MANAGER_API_ERROR_DB_ALIAS_UNKNOWN;
             }
 
             AssertMsg(!selectCommand->Step(),