Skip to content

Commit c180676

Browse files
authored
Merge pull request #8987 from davidsaada/david_securestore_fixes
Fix a few SecureStore issues (following preliminary security review)
2 parents 3875ac1 + cb7f68e commit c180676

File tree

9 files changed

+119
-156
lines changed

9 files changed

+119
-156
lines changed

docs/design-documents/features/storage/KVStore/KVStore_design.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ class KVStore {
8282
enum create_flags {
8383
WRITE_ONCE_FLAG = (1 << 0),
8484
REQUIRE_CONFIDENTIALITY_FLAG = (1 << 1),
85-
REQUIRE_INTEGRITY_FLAG = (1 << 2),
8685
REQUIRE_REPLAY_PROTECTION_FLAG = (1 << 3),
8786
};
8887

@@ -130,7 +129,6 @@ As mentioned above, each KVStore API has a parallel C-style API, used globally w
130129
enum kv_create_flags {
131130
KV_WRITE_ONCE_FLAG = (1 << 0),
132131
KV_REQUIRE_CONFIDENTIALITY_FLAG = (1 << 1),
133-
KV_REQUIRE_INTEGRITY_FLAG = (1 << 2),
134132
KV_REQUIRE_REPLAY_PROTECTION_FLAG = (1 << 3),
135133
};
136134

docs/design-documents/features/storage/SecureStore/SecureStore_design.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ SecureStore is a storage class, derived from KVStore. It adds security features
4747
As such, it offers all KVStore APIs, with additional security options (which can be selected using the creation flags at set). These include:
4848

4949
- Encryption: Data is encrypted using the AES-CTR encryption method, with a randomly generated 8-byte IV. Key is derived from [Device Key](../../../../../../mbed-os/features/device_key/README.md), using the NIST SP 800-108 KDF in counter mode spec, where salt is the key trimmed to 32 bytes, with "ENC" as prefix. Flag here is called "require confidentiality flag".
50-
- Authentication: A 16-byte CMAC is calculated on all stored data (including metadata) and stored at the end of the record. When reading the record, calculated CMAC is compared with the stored one. In the case of encryption, CMAC is calculated on the encrypted data. The key used for generating the CMAC is derived from [Device Key](../../../../../../mbed-os/features/device_key/README.md), where salt is the key trimmed to 32 bytes, with "AUTH" as prefix. Flag here is called "Require integrity flag".
5150
- Rollback protection: (Requires authentication) CMAC is stored in a designated rollback protected storage (also of KVStore type) and compared to when reading the data under the same KVStore key. A missing or different key in the rollback protected storage results in an error. The flag here is called "Require replay protection flag".
5251
- Write once: Key can only be stored once and can't be removed. The flag here is called "Write once flag".
5352

53+
SecureStore maintains data integrity using a record CMAC. This 16-byte CMAC is calculated on all stored data (including key & metadata) and stored at the end of the record. When reading the record, SecureStore compares the calculated CMAC with the stored one. In the case of encryption, CMAC is calculated on the encrypted data. The key used for generating the CMAC is derived from [Device Key](../../../../../../mbed-os/features/device_key/README.md), where salt is the key trimmed to 32 bytes, with "AUTH" as prefix.
54+
5455
![SecureStore Layers](./SecureStore_layers.jpg)
5556

5657
### Data layout
@@ -73,7 +74,8 @@ Fields are:
7374

7475
Because the code can't construct a single buffer to store all data (including metadata and possibly encrypted data) in one shot, setting the data occurs in chunks, using the incremental set APIs. Get uses the offset argument to extract metadata, data and CMAC separately.
7576

76-
Rollback protection (RBP) keys are stored in the designated rollback protection storage, which is also of KVStore type. RBP keys are the same as the SecureStore keys.
77+
Rollback protection (RBP) keys are stored in the designated rollback protection storage, which is also of KVStore type. RBP keys are the same as the SecureStore keys.
78+
This RBP storage is also used for storing the CMAC in write once case, as otherwise an attacker can delete this key from the underlying storage and modify this flag.
7779

7880
# Detailed design
7981

@@ -227,14 +229,13 @@ Pseudo code:
227229
- Take `_mutex`.
228230
- Call `_underlying_kv` `get` API with `metadata` size into a `metadata` local structure.
229231
- If failure:
230-
- If rollback protection flag set:
232+
- If rollback protection or write once flag set:
231233
- Call `_rbp_kv` `get` API on a local `rbp_cmac` variable, key is `key`, size 16.
232234
- If no error, return "RBP authentication" error.
233235
- Return "Key not found error".
234-
- If authentication flag set:
235-
- Derive a key from device key and `key`.
236-
- Allocate and initialize `auth_handle` CMAC calculation local handle with derived key.
237-
- Using `auth_handle` handle, calculate CMAC on `key` and `metadata`.
236+
- Derive a key from device key and `key`.
237+
- Allocate and initialize `auth_handle` CMAC calculation local handle with derived key.
238+
- Using `auth_handle` handle, calculate CMAC on `key` and `metadata`.
238239
- If encrypt flag set:
239240
- Derive a key from device key and `key`.
240241
- Allocate and initialize a local `enc_handle` AES-CTR local handle with derived key and `iv` field.
@@ -247,13 +248,13 @@ Pseudo code:
247248
- Else:
248249
- Set `dest_buf` to `_scratch_buf` and `chunk_size` to `actual_size`.
249250
- Call `_underlying_kv` `get` API with `dest_buf` and `chunk_size`.
250-
- If authentication flag set, calculate CMAC on `dest_buf`, using `_auth_handle` handle.
251+
- Calculate CMAC on `dest_buf`, using `_auth_handle` handle.
251252
- If encrypt flag set, decrypt `dest_buf` (in place) using `_enc_handle` handle.
252253
- Decrement `data_size` by `chunk_size`.
253254
- Call `_underlying_kv` `get` API with on a local `read_cmac` variable, size 16.
254255
- Generate CMAC on local `cmac` variable .
255256
- Using `mbedtls_ssl_safer_memcmp` function, compare `read_cmac` with `cmac`. Return "data corrupt error" if no match.
256-
- If rollback protection flag set:
257+
- If rollback protection or write once flags set:
257258
- Call `_rbp_kv` `get` API on a local `rbp_cmac` variable, key is `key`, size 16.
258259
- If `rbp_cmac` doesn't match `cmac`, clear `buffer` and return "RBP authentication" error.
259260
- Deinitialize and free `auth_handle` and `enc_handle`.
@@ -312,10 +313,9 @@ Pseudo code:
312313
- Using TLS entropy function on `_entropy` handle, randomly generate `iv` field.
313314
- Allocate and initialize `enc_handle` AES-CTR handle field with derived key and `iv` field.
314315
- Fill all available fields in `metadata`.
315-
- If authentication flag set:
316-
- Derive a key from device key and `key` as salt (trimmed to 32 bytes with "AUTH" as prefix).
317-
- Allocate and initialize `auth_handle` CMAC calculation handle field with derived key.
318-
- Using `auth_handle` handle, calculate CMAC on `key` and `metadata`.
316+
- Derive a key from device key and `key` as salt (trimmed to 32 bytes with "AUTH" as prefix).
317+
- Allocate and initialize `auth_handle` CMAC calculation handle field with derived key.
318+
- Using `auth_handle` handle, calculate CMAC on `key` and `metadata`.
319319
- Call `_underlying_kv` `set_start` API.
320320
- Call `_underlying_kv` `set_add_data` API with `metadata` field.
321321
- Return OK.
@@ -332,10 +332,10 @@ Pseudo code:
332332
- If flags include encryption:
333333
- Iterate over `value_data` field in chunks of `_scratch_buf` size.
334334
- Using `enc_handle` handle field, encrypt chunk into `_scratch_buf`.
335-
- If authentication flag set, using `auth_handle` handle field, update CMAC of `_scratch_buf`.
335+
- Using `auth_handle` handle field, update CMAC of `_scratch_buf`.
336336
- Call `_underlying_kv` `set_add_data` API with `_scratch_buf`.
337337
- Else:
338-
- If authentication flag set, using `auth_handle` handle field, update CMAC of `value_data`.
338+
- Using `auth_handle` handle field, update CMAC of `value_data`.
339339
- Call `_underlying_kv` `set_add_data` API with `value_data`.
340340
- Update `offset` field in handle.
341341
- Return OK.
@@ -352,7 +352,7 @@ Pseudo code:
352352
- If authentication flag set, using `auth_handle` handle field, generate `cmac`.
353353
- Call `_underlying_kv` `set_add_data` API with `cmac`.
354354
- Call `_underlying_kv` `set_finalize`.
355-
- If rollback protect flag set, call `_rbp_kv` `set` API with `key` as key and `cmac` as data.
355+
- If rollback protect or write once flags set, call `_rbp_kv` `set` API with `key` as key and `cmac` as data.
356356
- Deinitialize and free `auth_handle` and `enc_handle`.
357357
- Free `handle`.
358358
- Release `_mutex`.
@@ -426,10 +426,10 @@ res = secure_store.init();
426426

427427
const char *val1 = "Value of key 1";
428428
const char *val2 = "Updated value of key 1";
429-
// Add "Key1" with encryption and authentication flags
430-
res = secure_store.set("Key1", val1, sizeof(val1), KVSTore::REQUIRE_CONFIDENTIALITY_FLAG | KVSTore::REQUIRE_INTEGRITY_FLAG);
429+
// Add "Key1" with encryption flag
430+
res = secure_store.set("Key1", val1, sizeof(val1), KVSTore::REQUIRE_CONFIDENTIALITY_FLAG);
431431
// Update value of "Key1" (flags must be the same per key)
432-
res = secure_store.set("Key1", val2, sizeof(val2), KVSTore::REQUIRE_CONFIDENTIALITY_FLAG | KVSTore::REQUIRE_INTEGRITY_FLAG);
432+
res = secure_store.set("Key1", val2, sizeof(val2), KVSTore::REQUIRE_CONFIDENTIALITY_FLAG);
433433

434434
uint_8 value[32];
435435
size_t actual_size;

features/storage/TESTS/kvstore/general_tests_phase_1/main.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -414,18 +414,6 @@ static void set_several_key_value_sizes()
414414
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, res);
415415
}
416416

417-
//set key with ROLLBACK flag without AUTHENTICATION flag
418-
static void Sec_set_key_rollback_without_auth_flag()
419-
{
420-
TEST_SKIP_UNLESS(kvstore != NULL);
421-
if (kv_setup != SecStoreSet) {
422-
return;
423-
}
424-
425-
int res = kvstore->set(key, data, data_size, KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
426-
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_ERROR_INVALID_ARGUMENT, res);
427-
}
428-
429417
//set key with ROLLBACK flag and retrieve it, set it again with no ROLBACK
430418
static void Sec_set_key_rollback_set_again_no_rollback()
431419
{
@@ -436,7 +424,7 @@ static void Sec_set_key_rollback_set_again_no_rollback()
436424
return;
437425
}
438426

439-
int res = kvstore->set(key_name, data, data_size, KVStore::REQUIRE_REPLAY_PROTECTION_FLAG | KVStore::REQUIRE_INTEGRITY_FLAG);
427+
int res = kvstore->set(key_name, data, data_size, KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
440428
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, res);
441429

442430
res = kvstore->get(key_name, buffer, sizeof(buffer), &actual_size, 0);
@@ -479,7 +467,7 @@ static void Sec_set_key_auth()
479467
return;
480468
}
481469

482-
int res = kvstore->set(key, data, data_size, KVStore::REQUIRE_INTEGRITY_FLAG);
470+
int res = kvstore->set(key, data, data_size, 0);
483471
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, res);
484472

485473
res = kvstore->get(key, buffer, sizeof(buffer), &actual_size, 0);
@@ -768,7 +756,6 @@ template_case_t template_cases[] = {
768756
{"set_key_value_seventeen_byte_size", set_key_value_seventeen_byte_size, greentea_failure_handler},
769757
{"set_several_key_value_sizes", set_several_key_value_sizes, greentea_failure_handler},
770758

771-
{"Sec_set_key_rollback_without_auth_flag", Sec_set_key_rollback_without_auth_flag, greentea_failure_handler},
772759
{"Sec_set_key_rollback_set_again_no_rollback", Sec_set_key_rollback_set_again_no_rollback, greentea_failure_handler},
773760
{"Sec_set_key_encrypt", Sec_set_key_encrypt, greentea_failure_handler},
774761
{"Sec_set_key_auth", Sec_set_key_auth, greentea_failure_handler},

features/storage/TESTS/kvstore/securestore_whitebox/main.cpp

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ static void white_box_test()
148148
elapsed = timer.read_ms();
149149
printf("Elapsed time for reset is %d ms\n", elapsed);
150150

151-
result = sec_kv->set(key1, key1_val1, strlen(key1_val1), KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_INTEGRITY_FLAG);
151+
result = sec_kv->set(key1, key1_val1, strlen(key1_val1), KVStore::REQUIRE_CONFIDENTIALITY_FLAG);
152152
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
153153

154-
result = sec_kv->set(key2, key2_val1, strlen(key2_val1), KVStore::REQUIRE_INTEGRITY_FLAG);
154+
result = sec_kv->set(key2, key2_val1, strlen(key2_val1), 0);
155155
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
156156

157-
result = sec_kv->set(key2, key2_val2, strlen(key2_val2), KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_INTEGRITY_FLAG);
157+
result = sec_kv->set(key2, key2_val2, strlen(key2_val2), KVStore::REQUIRE_CONFIDENTIALITY_FLAG);
158158
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
159159

160160
result = sec_kv->get(key2, get_buf, sizeof(get_buf), &actual_data_size);
@@ -163,18 +163,17 @@ static void white_box_test()
163163
TEST_ASSERT_EQUAL_STRING_LEN(key2_val2, get_buf, strlen(key2_val2));
164164

165165
timer.reset();
166-
result = sec_kv->set(key2, key2_val3, strlen(key2_val3), KVStore::REQUIRE_INTEGRITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
166+
result = sec_kv->set(key2, key2_val3, strlen(key2_val3), KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
167167
elapsed = timer.read_ms();
168168
printf("Elapsed time for set is %d ms\n", elapsed);
169169

170170
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
171171

172172
result = sec_kv->set(key3, key3_val1, strlen(key3_val1),
173-
KVStore::REQUIRE_INTEGRITY_FLAG | KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
173+
KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
174174
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
175175

176-
result = sec_kv->set(key3, key3_val2, strlen(key3_val2),
177-
KVStore::REQUIRE_INTEGRITY_FLAG | KVStore::REQUIRE_CONFIDENTIALITY_FLAG);
176+
result = sec_kv->set(key3, key3_val2, strlen(key3_val2), KVStore::REQUIRE_CONFIDENTIALITY_FLAG);
178177
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_ERROR_INVALID_ARGUMENT, result);
179178

180179
result = sec_kv->get(key3, get_buf, sizeof(get_buf), &actual_data_size);
@@ -183,18 +182,16 @@ static void white_box_test()
183182
TEST_ASSERT_EQUAL_STRING_LEN(key3_val1, get_buf, strlen(key3_val1));
184183

185184
for (int j = 0; j < 2; j++) {
186-
result = sec_kv->set(key4, key4_val1, strlen(key4_val1),
187-
KVStore::REQUIRE_INTEGRITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
185+
result = sec_kv->set(key4, key4_val1, strlen(key4_val1), KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
188186
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
189187

190-
result = sec_kv->set(key4, key4_val2, strlen(key4_val2),
191-
KVStore::REQUIRE_INTEGRITY_FLAG | KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
188+
result = sec_kv->set(key4, key4_val2, strlen(key4_val2), KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
192189
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
193190
}
194191

195192
result = sec_kv->get_info(key3, &info);
196193
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
197-
TEST_ASSERT_EQUAL(KVStore::REQUIRE_INTEGRITY_FLAG | KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG, info.flags);
194+
TEST_ASSERT_EQUAL(KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG, info.flags);
198195
TEST_ASSERT_EQUAL(strlen(key3_val1), info.size);
199196

200197
result = ul_kv->get_info(key3, &info);
@@ -224,7 +221,7 @@ static void white_box_test()
224221
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_ERROR_ITEM_NOT_FOUND, result);
225222

226223
result = sec_kv->set(key5, key5_val1, strlen(key5_val1),
227-
KVStore::REQUIRE_INTEGRITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG | KVStore::WRITE_ONCE_FLAG);
224+
KVStore::REQUIRE_REPLAY_PROTECTION_FLAG | KVStore::WRITE_ONCE_FLAG);
228225
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
229226

230227
#ifndef NO_RBP_MODE
@@ -234,7 +231,7 @@ static void white_box_test()
234231
#endif
235232

236233
result = sec_kv->set(key5, key5_val2, strlen(key5_val2),
237-
KVStore::REQUIRE_INTEGRITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG | KVStore::WRITE_ONCE_FLAG);
234+
KVStore::REQUIRE_REPLAY_PROTECTION_FLAG | KVStore::WRITE_ONCE_FLAG);
238235
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_ERROR_WRITE_PROTECTED, result);
239236

240237
result = sec_kv->remove(key5);
@@ -315,7 +312,7 @@ static void white_box_test()
315312
TEST_ASSERT_EQUAL_STRING_LEN(key4_val2, get_buf, strlen(key4_val2));
316313

317314
result = sec_kv->set(key6, key6_val1, strlen(key6_val1),
318-
KVStore::REQUIRE_INTEGRITY_FLAG | KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
315+
KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
319316
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
320317

321318
#ifndef NO_RBP_MODE
@@ -326,7 +323,7 @@ static void white_box_test()
326323
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
327324

328325
result = sec_kv->set(key6, key6_val2, strlen(key6_val2),
329-
KVStore::REQUIRE_INTEGRITY_FLAG | KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
326+
KVStore::REQUIRE_CONFIDENTIALITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
330327
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
331328

332329
result = ul_kv->set(key6, attack_buf, attack_size, 0);
@@ -342,7 +339,7 @@ static void white_box_test()
342339
int cmac_size = info.size;
343340
uint8_t *cmac = new uint8_t[cmac_size];
344341

345-
result = sec_kv->set(key7, key7_val1, strlen(key7_val1), KVStore::REQUIRE_INTEGRITY_FLAG);
342+
result = sec_kv->set(key7, key7_val1, strlen(key7_val1), 0);
346343
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
347344

348345
result = ul_kv->get(key7, attack_buf, sizeof(attack_buf), &attack_size);
@@ -351,7 +348,7 @@ static void white_box_test()
351348
int data_offset = attack_size - cmac_size - strlen(key7_val1);
352349
TEST_ASSERT_EQUAL(0, strncmp(key7_val1, attack_buf + data_offset, strlen(key7_val1)));
353350

354-
result = sec_kv->set(key7, key7_val1, strlen(key7_val1), KVStore::REQUIRE_INTEGRITY_FLAG | KVStore::REQUIRE_CONFIDENTIALITY_FLAG);
351+
result = sec_kv->set(key7, key7_val1, strlen(key7_val1), KVStore::REQUIRE_CONFIDENTIALITY_FLAG);
355352
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, result);
356353

357354
result = ul_kv->get(key7, attack_buf, sizeof(attack_buf), &attack_size);

features/storage/kvstore/KVStore.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class KVStore {
3232
enum create_flags {
3333
WRITE_ONCE_FLAG = (1 << 0),
3434
REQUIRE_CONFIDENTIALITY_FLAG = (1 << 1),
35-
REQUIRE_INTEGRITY_FLAG = (1 << 2),
35+
RESERVED_FLAG = (1 << 2),
3636
REQUIRE_REPLAY_PROTECTION_FLAG = (1 << 3),
3737
};
3838

@@ -54,7 +54,6 @@ class KVStore {
5454
* The Key flags, possible flags combination:
5555
* WRITE_ONCE_FLAG,
5656
* REQUIRE_CONFIDENTIALITY_FLAG,
57-
* REQUIRE_INTEGRITY_FLAG,
5857
* REQUIRE_REPLAY_PROTECTION_FLAG
5958
*/
6059
uint32_t flags;

features/storage/kvstore/conf/kv_config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ int _storage_config_TDB_INTERNAL()
590590
kvstore_config.internal_store;
591591

592592
kvstore_config.flags_mask = ~(KVStore::REQUIRE_CONFIDENTIALITY_FLAG |
593-
KVStore::REQUIRE_INTEGRITY_FLAG | KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
593+
KVStore::REQUIRE_REPLAY_PROTECTION_FLAG);
594594

595595
KVMap &kv_map = KVMap::get_instance();
596596
ret = kv_map.init();

features/storage/kvstore/global_api/kvstore_global_api.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef struct _opaque_kv_key_iterator *kv_iterator_t;
2727

2828
#define KV_WRITE_ONCE_FLAG (1 << 0)
2929
#define KV_REQUIRE_CONFIDENTIALITY_FLAG (1 << 1)
30-
#define KV_REQUIRE_INTEGRITY_FLAG (1 << 2)
30+
#define KV_RESERVED_FLAG (1 << 2)
3131
#define KV_REQUIRE_REPLAY_PROTECTION_FLAG (1 << 3)
3232

3333
#define KV_MAX_KEY_LENGTH 128
@@ -44,7 +44,6 @@ typedef struct info {
4444
* The Key flags, possible flags combination:
4545
* WRITE_ONCE_FLAG,
4646
* REQUIRE_CONFIDENTIALITY_FLAG,
47-
* REQUIRE_INTEGRITY_FLAG,
4847
* REQUIRE_REPLAY_PROTECTION_FLAG
4948
*/
5049
uint32_t flags;

0 commit comments

Comments
 (0)