Skip to content

Commit 4ba1a54

Browse files
authored
Merge pull request ARMmbed#13433 from LDong-Arm/refactor_device_key
Refactor device_key
2 parents 08ef04d + a59bace commit 4ba1a54

File tree

8 files changed

+9
-6
lines changed

8 files changed

+9
-6
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
### Overview and background
3434

35-
SecureStore is a [KVStore](../KVStore/KVStore_design.md) based storage solution, providing security features on the stored data, such as encryption, authentication, rollback protection and write once, over an underlying KVStore class. It references an additional KVStore class for storing the rollback protection keys.
35+
SecureStore is a [KVStore](../KVStore/KVStore_design.md) based storage solution, providing security features on the stored data, such as encryption, authentication, rollback protection and write once, over an underlying KVStore class. It references an additional KVStore class for storing the rollback protection keys.
3636

3737
### Requirements and assumptions
3838

@@ -44,13 +44,13 @@ SecureStore assumes that the underlying KVStore instances are instantiated and i
4444

4545
SecureStore is a storage class, derived from KVStore. It adds security features to the underlying key value store.
4646

47-
As such, it offers all KVStore APIs, with additional security options (which can be selected using the creation flags at set). These include:
47+
As such, it offers all KVStore APIs, with additional security options (which can be selected using the creation flags at set). These include:
4848

49-
- 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".
49+
- 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/drivers/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".
5050
- 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".
5151
- Write once: Key can only be stored once and can't be removed. The flag here is called "Write once flag".
5252

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.
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/drivers/device_key/README.md), where salt is the key trimmed to 32 bytes, with "AUTH" as prefix.
5454

5555
![SecureStore Layers](./SecureStore_layers.jpg)
5656

features/device_key/README.md renamed to drivers/device_key/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ To instantiate DeviceKey, you need to call its `get_instance` member function as
4242
Run the DeviceKey functionality test with the `mbed` command as follows:
4343

4444
```
45-
```mbed test -n features-device_key-tests-device_key-functionality```
45+
```mbed test -n drivers-device_key-tests-tests-device_key-functionality```
4646
```
File renamed without changes.

storage/kvstore/securestore/include/securestore/SecureStore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include MBEDTLS_CONFIG_FILE
2424
#endif
2525

26-
#include "features/device_key/source/DeviceKey.h"
26+
#include "device_key/DeviceKey.h"
2727

2828
#define SECURESTORE_ENABLED 1
2929

tools/test/travis-ci/doxy-spellchecker/ignore.en.pws

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,7 @@ Hinnant
117117
Vin
118118
Vref
119119
ssid
120+
instantiation
121+
instantiations
122+
KVStore
120123
_doxy_

0 commit comments

Comments
 (0)