/*! \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
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";
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)) {
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(),
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");
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(),