mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 21:35:39 +01:00
3efcebbc5e
When registering a key in a secure element, go through the transaction mechanism. This makes the code simpler, at the expense of a few extra storage operations. Given that registering a key is typically very rare over the lifetime of a device, this is an acceptable loss. Drivers must now have a p_validate_slot_number method, otherwise registering a key is not possible. This reduces the risk that due to a mistake during the integration of a device, an application might claim a slot in a way that is not supported by the driver.
164 lines
8.3 KiB
Plaintext
164 lines
8.3 KiB
Plaintext
Register SE driver: good
|
|
register_one:2:PSA_DRV_SE_HAL_VERSION:PSA_SUCCESS
|
|
|
|
# Run this test case a second time to verify that the library deinit
|
|
# unregistered the first driver.
|
|
Register SE driver: good, again
|
|
register_one:2:PSA_DRV_SE_HAL_VERSION:PSA_SUCCESS
|
|
|
|
Register SE driver: invalid lifetime (0)
|
|
register_one:0:PSA_DRV_SE_HAL_VERSION:PSA_ERROR_INVALID_ARGUMENT
|
|
|
|
Register SE driver: invalid lifetime (VOLATILE)
|
|
register_one:PSA_KEY_LIFETIME_VOLATILE:PSA_DRV_SE_HAL_VERSION:PSA_ERROR_INVALID_ARGUMENT
|
|
|
|
Register SE driver: invalid lifetime (PERSISTENT)
|
|
register_one:PSA_KEY_LIFETIME_PERSISTENT:PSA_DRV_SE_HAL_VERSION:PSA_ERROR_INVALID_ARGUMENT
|
|
|
|
Register SE driver: invalid version (ancient)
|
|
register_one:2:0x00000003:PSA_ERROR_NOT_SUPPORTED
|
|
|
|
Register SE driver: invalid version (future)
|
|
register_one:2:PSA_DRV_SE_HAL_VERSION + 1:PSA_ERROR_NOT_SUPPORTED
|
|
|
|
Register SE driver: already registered
|
|
register_twice:3
|
|
|
|
Register SE driver: maximum number of drivers
|
|
register_max:
|
|
|
|
SE key import-export (p_allocate allows all slots)
|
|
key_creation_import_export:0:0
|
|
|
|
SE key import-export (p_allocate allows 1 slot)
|
|
key_creation_import_export:ARRAY_LENGTH( ram_slots ) - 1:0
|
|
|
|
SE key import-export, check after restart (slot 0)
|
|
key_creation_import_export:0:1
|
|
|
|
SE key import-export, check after restart (slot 3)
|
|
key_creation_import_export:3:1
|
|
|
|
Key creation in a specific slot (0)
|
|
key_creation_in_chosen_slot:0:0:PSA_SUCCESS
|
|
|
|
Key creation in a specific slot (max)
|
|
key_creation_in_chosen_slot:ARRAY_LENGTH( ram_slots ) - 1:0:PSA_SUCCESS
|
|
|
|
Key creation in a specific slot (0, restart)
|
|
key_creation_in_chosen_slot:0:1:PSA_SUCCESS
|
|
|
|
Key creation in a specific slot (max, restart)
|
|
key_creation_in_chosen_slot:ARRAY_LENGTH( ram_slots ) - 1:1:PSA_SUCCESS
|
|
|
|
Key creation in a specific slot (too large)
|
|
key_creation_in_chosen_slot:ARRAY_LENGTH( ram_slots ):0:PSA_ERROR_INVALID_ARGUMENT
|
|
|
|
Key import smoke test: AES-CTR
|
|
import_key_smoke:PSA_KEY_TYPE_AES:PSA_ALG_CTR:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
|
|
Key import smoke test: AES-CBC
|
|
import_key_smoke:PSA_KEY_TYPE_AES:PSA_ALG_CBC_NO_PADDING:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
|
|
Key import smoke test: AES-CMAC
|
|
import_key_smoke:PSA_KEY_TYPE_AES:PSA_ALG_CMAC:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
|
|
Key import smoke test: AES-CCM
|
|
import_key_smoke:PSA_KEY_TYPE_AES:PSA_ALG_CCM:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
|
|
Key import smoke test: AES-GCM
|
|
import_key_smoke:PSA_KEY_TYPE_AES:PSA_ALG_GCM:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
|
|
Key import smoke test: CAMELLIA-CTR
|
|
import_key_smoke:PSA_KEY_TYPE_CAMELLIA:PSA_ALG_CTR:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
|
|
Key import smoke test: CAMELLIA-CBC
|
|
import_key_smoke:PSA_KEY_TYPE_CAMELLIA:PSA_ALG_CBC_NO_PADDING:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
|
|
Key import smoke test: CAMELLIA-CMAC
|
|
import_key_smoke:PSA_KEY_TYPE_CAMELLIA:PSA_ALG_CMAC:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
|
|
Key import smoke test: CAMELLIA-CCM
|
|
import_key_smoke:PSA_KEY_TYPE_CAMELLIA:PSA_ALG_CCM:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
|
|
Key import smoke test: CAMELLIA-GCM
|
|
import_key_smoke:PSA_KEY_TYPE_CAMELLIA:PSA_ALG_GCM:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
|
|
Key import smoke test: HMAC-SHA-256
|
|
import_key_smoke:PSA_KEY_TYPE_HMAC:PSA_ALG_HMAC( PSA_ALG_SHA_256 ):"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
|
|
Key import smoke test: HKDF-SHA-256
|
|
import_key_smoke:PSA_KEY_TYPE_DERIVE:PSA_ALG_HKDF( PSA_ALG_SHA_256 ):"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
|
|
Key import smoke test: RSA PKCS#1v1.5 signature
|
|
import_key_smoke:PSA_KEY_TYPE_RSA_KEY_PAIR:PSA_ALG_RSA_PKCS1V15_SIGN_RAW:"30818902818100af057d396ee84fb75fdbb5c2b13c7fe5a654aa8aa2470b541ee1feb0b12d25c79711531249e1129628042dbbb6c120d1443524ef4c0e6e1d8956eeb2077af12349ddeee54483bc06c2c61948cd02b202e796aebd94d3a7cbf859c2c1819c324cb82b9cd34ede263a2abffe4733f077869e8660f7d6834da53d690ef7985f6bc30203010001"
|
|
|
|
Key import smoke test: RSA PKCS#1v1.5 encryption
|
|
import_key_smoke:PSA_KEY_TYPE_RSA_KEY_PAIR:PSA_ALG_RSA_PKCS1V15_CRYPT:"30818902818100af057d396ee84fb75fdbb5c2b13c7fe5a654aa8aa2470b541ee1feb0b12d25c79711531249e1129628042dbbb6c120d1443524ef4c0e6e1d8956eeb2077af12349ddeee54483bc06c2c61948cd02b202e796aebd94d3a7cbf859c2c1819c324cb82b9cd34ede263a2abffe4733f077869e8660f7d6834da53d690ef7985f6bc30203010001"
|
|
|
|
Key import smoke test: RSA OAEP encryption
|
|
import_key_smoke:PSA_KEY_TYPE_RSA_KEY_PAIR:PSA_ALG_RSA_OAEP( PSA_ALG_SHA_256 ):"30818902818100af057d396ee84fb75fdbb5c2b13c7fe5a654aa8aa2470b541ee1feb0b12d25c79711531249e1129628042dbbb6c120d1443524ef4c0e6e1d8956eeb2077af12349ddeee54483bc06c2c61948cd02b202e796aebd94d3a7cbf859c2c1819c324cb82b9cd34ede263a2abffe4733f077869e8660f7d6834da53d690ef7985f6bc30203010001"
|
|
|
|
Key import smoke test: ECDSA secp256r1
|
|
import_key_smoke:PSA_KEY_TYPE_ECC_KEY_PAIR( PSA_ECC_CURVE_SECP256R1 ):PSA_ALG_ECDSA_ANY:"49c9a8c18c4b885638c431cf1df1c994131609b580d4fd43a0cab17db2f13eee"
|
|
|
|
Key import smoke test: ECDH secp256r1
|
|
import_key_smoke:PSA_KEY_TYPE_ECC_KEY_PAIR( PSA_ECC_CURVE_SECP256R1 ):PSA_ALG_ECDH:"49c9a8c18c4b885638c431cf1df1c994131609b580d4fd43a0cab17db2f13eee"
|
|
|
|
Key import smoke test: ECDH secp256r1 with HKDF
|
|
import_key_smoke:PSA_KEY_TYPE_ECC_KEY_PAIR( PSA_ECC_CURVE_SECP256R1 ):PSA_ALG_KEY_AGREEMENT( PSA_ALG_ECDH, PSA_ALG_HKDF( PSA_ALG_SHA_256 ) ):"49c9a8c18c4b885638c431cf1df1c994131609b580d4fd43a0cab17db2f13eee"
|
|
|
|
Generate key: not supported
|
|
generate_key_not_supported:PSA_KEY_TYPE_AES:128
|
|
|
|
Key generation smoke test: AES-128-CTR
|
|
generate_key_smoke:PSA_KEY_TYPE_AES:128:PSA_ALG_CTR
|
|
|
|
Key generation smoke test: AES-256-CTR
|
|
generate_key_smoke:PSA_KEY_TYPE_AES:128:PSA_ALG_CTR
|
|
|
|
Key generation smoke test: HMAC-SHA-256
|
|
generate_key_smoke:PSA_KEY_TYPE_HMAC:256:PSA_ALG_HMAC( PSA_ALG_SHA_256 )
|
|
|
|
Key registration: smoke test
|
|
register_key_smoke_test:MIN_DRIVER_LIFETIME:1:PSA_SUCCESS
|
|
|
|
Key registration: invalid lifetime (volatile)
|
|
register_key_smoke_test:PSA_KEY_LIFETIME_VOLATILE:1:PSA_ERROR_INVALID_ARGUMENT
|
|
|
|
Key registration: invalid lifetime (internal storage)
|
|
register_key_smoke_test:PSA_KEY_LIFETIME_PERSISTENT:1:PSA_ERROR_INVALID_ARGUMENT
|
|
|
|
Key registration: invalid lifetime (no registered driver)
|
|
register_key_smoke_test:MIN_DRIVER_LIFETIME + 1:1:PSA_ERROR_INVALID_ARGUMENT
|
|
|
|
Key registration: rejected
|
|
register_key_smoke_test:MIN_DRIVER_LIFETIME:0:PSA_ERROR_NOT_PERMITTED
|
|
|
|
Key registration: not supported
|
|
register_key_smoke_test:MIN_DRIVER_LIFETIME:-1:PSA_ERROR_NOT_SUPPORTED
|
|
|
|
Import-sign-verify: sign in driver, ECDSA
|
|
depends_on:MBEDTLS_ECDSA_C:MBEDTLS_ECP_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
|
sign_verify:SIGN_IN_DRIVER_AND_PARALLEL_CREATION:PSA_KEY_TYPE_ECC_KEY_PAIR( PSA_ECC_CURVE_SECP256R1 ):PSA_ALG_ECDSA_ANY:0:"49c9a8c18c4b885638c431cf1df1c994131609b580d4fd43a0cab17db2f13eee":"54686973206973206e6f74206120686173682e"
|
|
|
|
Import-sign-verify: sign in driver then export_public, ECDSA
|
|
depends_on:MBEDTLS_ECDSA_C:MBEDTLS_ECP_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
|
sign_verify:SIGN_IN_DRIVER_THEN_EXPORT_PUBLIC:PSA_KEY_TYPE_ECC_KEY_PAIR( PSA_ECC_CURVE_SECP256R1 ):PSA_ALG_ECDSA_ANY:0:"49c9a8c18c4b885638c431cf1df1c994131609b580d4fd43a0cab17db2f13eee":"54686973206973206e6f74206120686173682e"
|
|
|
|
Import-sign-verify: sign in software, ECDSA
|
|
depends_on:MBEDTLS_ECDSA_C:MBEDTLS_ECP_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
|
sign_verify:SIGN_IN_SOFTWARE_AND_PARALLEL_CREATION:PSA_KEY_TYPE_ECC_KEY_PAIR( PSA_ECC_CURVE_SECP256R1 ):PSA_ALG_ECDSA_ANY:0:"49c9a8c18c4b885638c431cf1df1c994131609b580d4fd43a0cab17db2f13eee":"54686973206973206e6f74206120686173682e"
|
|
|
|
Generate-sign-verify: sign in driver, ECDSA
|
|
depends_on:MBEDTLS_ECDSA_C:MBEDTLS_ECP_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
|
sign_verify:SIGN_IN_DRIVER_AND_PARALLEL_CREATION:PSA_KEY_TYPE_ECC_KEY_PAIR( PSA_ECC_CURVE_SECP256R1 ):PSA_ALG_ECDSA_ANY:256:"49c9a8c18c4b885638c431cf1df1c994131609b580d4fd43a0cab17db2f13eee":"54686973206973206e6f74206120686173682e"
|
|
|
|
Generate-sign-verify: sign in driver then export_public, ECDSA
|
|
depends_on:MBEDTLS_ECDSA_C:MBEDTLS_ECP_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
|
sign_verify:SIGN_IN_DRIVER_THEN_EXPORT_PUBLIC:PSA_KEY_TYPE_ECC_KEY_PAIR( PSA_ECC_CURVE_SECP256R1 ):PSA_ALG_ECDSA_ANY:256:"49c9a8c18c4b885638c431cf1df1c994131609b580d4fd43a0cab17db2f13eee":"54686973206973206e6f74206120686173682e"
|
|
|
|
Generate-sign-verify: sign in software, ECDSA
|
|
depends_on:MBEDTLS_ECDSA_C:MBEDTLS_ECP_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
|
sign_verify:SIGN_IN_SOFTWARE_AND_PARALLEL_CREATION:PSA_KEY_TYPE_ECC_KEY_PAIR( PSA_ECC_CURVE_SECP256R1 ):PSA_ALG_ECDSA_ANY:256:"49c9a8c18c4b885638c431cf1df1c994131609b580d4fd43a0cab17db2f13eee":"54686973206973206e6f74206120686173682e"
|