Skip to content

Commit 6ef6424

Browse files
committed
testing/crypto: add key management test
Exercise the cryptodev key-id mechanism: with CRD_F_KEYID the key field of a session or kprocess request references an imported key in the swkey store instead of the key material. Every case runs a full key lifecycle (allocate, import, operate by key id, delete): the lifecycle round trip itself, AES-CBC, HMAC, AES-CMAC (cipher and mac keys both by id), ECDSA (generate then sign/verify by id) and RSA-1024 (n/e/d as three key ids: encrypt/decrypt round trip and PKCS#1 v1.5 sign/verify). Signed-off-by: makejian <makejian@xiaomi.com>
1 parent 5ff9666 commit 6ef6424

4 files changed

Lines changed: 1152 additions & 0 deletions

File tree

‎testing/drivers/crypto/CMakeLists.txt‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ if(CONFIG_TESTING_CRYPTO)
330330
nuttx_add_application(
331331
NAME
332332
async
333+
>>>>>>> 7f6b2f48af (testing/crypto: add key management test)
333334
PRIORITY
334335
${CONFIG_TESTING_CRYPTO_PRIORITY}
335336
STACKSIZE
@@ -340,4 +341,18 @@ if(CONFIG_TESTING_CRYPTO)
340341
async.c)
341342
endif()
342343

344+
if(CONFIG_TESTING_CRYPTO_KEY_MANAGEMENT)
345+
nuttx_add_application(
346+
NAME
347+
keymanagement
348+
PRIORITY
349+
${CONFIG_TESTING_CRYPTO_PRIORITY}
350+
STACKSIZE
351+
${CONFIG_TESTING_CRYPTO_STACKSIZE}
352+
MODULE
353+
${CONFIG_TESTING_CRYPTO}
354+
SRCS
355+
keymanagement.c)
356+
endif()
357+
343358
endif()

‎testing/drivers/crypto/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,8 @@ config TESTING_CRYPTO_ASYNC
172172
bool "async crypto test"
173173
default n
174174

175+
config TESTING_CRYPTO_KEY_MANAGEMENT
176+
bool "key management crypto test"
177+
default n
178+
175179
endif # TESTING_CRYPTO

‎testing/drivers/crypto/Makefile‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ PROGNAME += async
133133
MAINSRC += async.c
134134
endif
135135

136+
ifeq ($(CONFIG_TESTING_CRYPTO_KEY_MANAGEMENT),y)
137+
PROGNAME += keymanagement
138+
MAINSRC += keymanagement.c
139+
endif
140+
136141
PRIORITY = $(CONFIG_TESTING_CRYPTO_PRIORITY)
137142
STACKSIZE = $(CONFIG_TESTING_CRYPTO_STACKSIZE)
138143
MODULE = $(CONFIG_TESTING_CRYPTO)

0 commit comments

Comments
 (0)