mirror of https://github.com/ARMmbed/mbed-os.git
SecureStore: Add member initializers for inc_handle_t
_inc_set_handle is new'd in SecureStore::init(), then its members are referenced in various functions without being explicitly initialized first. These pre-existing values can confuse the SecureStore's internal state and cause various undesired behavior.pull/11810/head
parent
18d4adf04f
commit
db4dafc15a
|
@ -52,19 +52,19 @@ static const uint32_t security_flags = KVStore::REQUIRE_CONFIDENTIALITY_FLAG | K
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint16_t metadata_size;
|
uint16_t metadata_size = 0u;
|
||||||
uint16_t revision;
|
uint16_t revision = 0u;
|
||||||
uint32_t data_size;
|
uint32_t data_size = 0u;
|
||||||
uint32_t create_flags;
|
uint32_t create_flags = 0u;
|
||||||
uint8_t iv[iv_size];
|
uint8_t iv[iv_size] = { 0u };
|
||||||
} record_metadata_t;
|
} record_metadata_t;
|
||||||
|
|
||||||
// incremental set handle
|
// incremental set handle
|
||||||
typedef struct {
|
typedef struct {
|
||||||
record_metadata_t metadata;
|
record_metadata_t metadata;
|
||||||
char *key;
|
char *key = nullptr;
|
||||||
uint32_t offset_in_data;
|
uint32_t offset_in_data = 0u;
|
||||||
uint8_t ctr_buf[enc_block_size];
|
uint8_t ctr_buf[enc_block_size] = { 0u };
|
||||||
mbedtls_aes_context enc_ctx;
|
mbedtls_aes_context enc_ctx;
|
||||||
mbedtls_cipher_context_t auth_ctx;
|
mbedtls_cipher_context_t auth_ctx;
|
||||||
KVStore::set_handle_t underlying_handle;
|
KVStore::set_handle_t underlying_handle;
|
||||||
|
|
Loading…
Reference in New Issue