From 73d1c8df93c67ea9e16f5bf1a188eb449a983693 Mon Sep 17 00:00:00 2001 From: Yossi Levy Date: Mon, 14 May 2018 13:52:20 +0300 Subject: [PATCH] Fix of error macros --- features/device_key/source/DeviceKey.cpp | 6 +++--- features/device_key/source/DeviceKey.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/features/device_key/source/DeviceKey.cpp b/features/device_key/source/DeviceKey.cpp index 7d703b6a43..c61c9d626e 100644 --- a/features/device_key/source/DeviceKey.cpp +++ b/features/device_key/source/DeviceKey.cpp @@ -122,7 +122,7 @@ int DeviceKey::write_key_to_nvstore(uint32_t *input, size_t isize) } if (NVSTORE_SUCCESS != ret) { - return DEVICEKEY_NVSTORE_UNPREDICTABLE_ERROR; + return DEVICEKEY_NVSTORE_UNPREDICTED_ERROR; } return DEVICEKEY_SUCCESS; @@ -147,7 +147,7 @@ int DeviceKey::read_key_from_nvstore(uint32_t *output, size_t& size) } if (NVSTORE_SUCCESS != nvStatus) { - return DEVICEKEY_NVSTORE_UNPREDICTABLE_ERROR; + return DEVICEKEY_NVSTORE_UNPREDICTED_ERROR; } size = out_size; @@ -242,7 +242,7 @@ int DeviceKey::generate_key_by_trng(uint32_t *output, size_t& size) memset(output, 0, size); if (DEVICE_KEY_16BYTE > size) { - return DEVICEKEY_BUFFER_TO_SMALL; + return DEVICEKEY_BUFFER_TOO_SMALL; } else if (DEVICE_KEY_16BYTE <= size && DEVICE_KEY_32BYTE > size) { size = DEVICE_KEY_16BYTE; } else { diff --git a/features/device_key/source/DeviceKey.h b/features/device_key/source/DeviceKey.h index 0f4cdfb6b2..301d288763 100644 --- a/features/device_key/source/DeviceKey.h +++ b/features/device_key/source/DeviceKey.h @@ -36,9 +36,9 @@ enum DeviceKeyStatus { DEVICEKEY_ALREADY_EXIST = -4, DEVICEKEY_NOT_FOUND = -5, DEVICEKEY_READ_FAILED = -6, - DEVICEKEY_NVSTORE_UNPREDICTABLE_ERROR = -7, + DEVICEKEY_NVSTORE_UNPREDICTED_ERROR = -7, DEVICEKEY_ERR_CMAC_GENERIC_FAILURE = -8, - DEVICEKEY_BUFFER_TO_SMALL = -9, + DEVICEKEY_BUFFER_TOO_SMALL = -9, DEVICEKEY_NO_KEY_INJECTED = -10, DEVICEKEY_INVALID_PARAM = -11, DEVICEKEY_TRNG_ERROR = -12,