psa: Add storage implementation for files
Add new functions, psa_load_persistent_key(),
psa_free_persistent_key_data(), and psa_save_persistent_key(), for
managing persistent keys. These functions load to or save from our
internal representation of key slots. Serialization is a concern of the
storage backend implementation and doesn't abstraction-leak into the
lifetime management code.
An initial implementation for files is provided. Additional storage
backends can implement this interface for other storage types.
diff --git a/crypto/library/Makefile b/crypto/library/Makefile
index 9151662..5b963c5 100644
--- a/crypto/library/Makefile
+++ b/crypto/library/Makefile
@@ -45,6 +45,8 @@
platform.o \
platform_util.o \
psa_crypto.o \
+ psa_crypto_storage.o \
+ psa_crypto_storage_file.o \
ripemd160.o \
rsa_internal.o \
rsa.o \
diff --git a/crypto/tests/Makefile b/crypto/tests/Makefile
index b44b470..2f68e86 100644
--- a/crypto/tests/Makefile
+++ b/crypto/tests/Makefile
@@ -16,11 +16,13 @@
APPS := \
test_suite_psa_crypto \
test_suite_psa_crypto_metadata \
+ test_suite_psa_crypto_storage_file \
# Don't delete this line.
# Look up for associated function files
func.test_suite_psa_crypto := test_suite_psa_crypto
func.test_suite_psa_crypto_metadata := test_suite_psa_crypto_metadata
+func.test_suite_psa_crypto_storage_file := test_suite_psa_crypto_storage_file
.SILENT:
@@ -56,6 +58,7 @@
test: $(APPS)
./test_suite_psa_crypto_metadata
./test_suite_psa_crypto
+ ./test_suite_psa_crypto_storage_file
# Create separate targets for generating embedded tests.
EMBEDDED_TESTS := $(addprefix embedded_,$(APPS))