Missing error handling in SOPC_KeyManager_AsymmetricKey_CreateFromFile()
In the file src/Common/crypto/lib_dep/cyclone/key_manager_cyclone.c
, the error code errLib
from the call of pemDecryptPrivateKey()
in line 192 is only handled in case of no errors.
Current code:
if (!errLib)
{
status = SOPC_KeyManager_AsymmetricKey_CreateFromBuffer((uint8_t*) buffer_decrypted,
(uint32_t) lenBuffer_decrypted, false, ppKey);
}
Suggested change:
if (errLib)
{
status = SOPC_STATUS_NOK:
}
else
{
status = SOPC_KeyManager_AsymmetricKey_CreateFromBuffer((uint8_t*) buffer_decrypted,
(uint32_t) lenBuffer_decrypted, false, ppKey);
}