RawBuffer encryptWithDbpKey(const unsigned char* key, const uint32_t key_len,
const unsigned char* iv, const uint32_t iv_len)
{
-
- unsigned char* output_data;
- uint32_t output_len;
+ unsigned char* output_data = NULL;
+ uint32_t output_len = 0;
+ LogDebug("DBP Key will be encrypted on SE backend");
int ret = kmsb_failure_retry(std::bind(kmsb_encrypt_with_dbp_key,
SE_BACKEND_DBP_SCHEME_VERSION,
iv, iv_len,
&output_data, &output_len));
if (ret == KMSB_ERROR_NO_KEY) {
- ret = kmsb_failure_retry(std::bind(kmsb_generate_dbp_key,
+ ret = kmsb_failure_retry(std::bind(kmsb_generate_dbp_key,
false));
if (ret != KMSB_ERROR_NONE) {
LogError("Generate Key: SE Internal error: " << ret);
#if SE_BACKEND_ENABLED
RawBuffer salt;
if (keyInfo.backend == (int)CryptoBackend::SecureElement) {
- RawBuffer salt = Crypto::SE::Internals::encryptWithDbpKey((unsigned char*)keyInfo.salt, MAX_SALT_SIZE,
+ salt = Crypto::SE::Internals::encryptWithDbpKey((unsigned char*)keyInfo.salt, MAX_SALT_SIZE,
(unsigned char*)keyInfo.iv, MAX_IV_SIZE);
} else {
salt = RawBuffer(keyInfo.salt, keyInfo.salt + MAX_SALT_SIZE);