psa_copy_key: Add test cases to specifically check non-exportability

Test that copying a non-exportable key doesn't make it exportable.
This complements similar tests that exercise a different usage flag.
This commit is contained in:
Gilles Peskine 2019-02-05 20:29:31 +01:00
parent aec5a7fd49
commit e84d5d2f1c

View File

@ -503,10 +503,14 @@ Copy key: AES, fewer usage flags
depends_on:MBEDTLS_AES_C:MBEDTLS_CIPHER_MODE_CTR
copy_key_policy:PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_EXPORT:PSA_ALG_CTR:PSA_KEY_TYPE_AES:"404142434445464748494a4b4c4d4e4f":PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR:-1:-1:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR
Copy key: AES, more usage flags
Copy key: AES, 1 more usage flag
depends_on:MBEDTLS_AES_C:MBEDTLS_CIPHER_MODE_CTR
copy_key_policy:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR:PSA_KEY_TYPE_AES:"404142434445464748494a4b4c4d4e4f":PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT:PSA_ALG_CTR:-1:-1:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR
Copy key: AES, 2 more usage flags
depends_on:MBEDTLS_AES_C:MBEDTLS_CIPHER_MODE_CTR
copy_key_policy:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR:PSA_KEY_TYPE_AES:"404142434445464748494a4b4c4d4e4f":PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT | PSA_KEY_USAGE_EXPORT:PSA_ALG_CTR:-1:-1:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR
Copy key: AES, intersect usage flags
depends_on:MBEDTLS_AES_C:MBEDTLS_CIPHER_MODE_CTR
copy_key_policy:PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_EXPORT:PSA_ALG_CTR:PSA_KEY_TYPE_AES:"404142434445464748494a4b4c4d4e4f":PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT:PSA_ALG_CTR:-1:-1:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR
@ -519,10 +523,14 @@ Copy key: AES, source=target, constraint with fewer usage flags
depends_on:MBEDTLS_AES_C:MBEDTLS_CIPHER_MODE_CTR
copy_key_policy:PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_EXPORT:PSA_ALG_CTR:PSA_KEY_TYPE_AES:"404142434445464748494a4b4c4d4e4f":PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_EXPORT:PSA_ALG_CTR:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR
Copy key: AES, source=target, constraint with more usage flags
Copy key: AES, source=target, constraint with 1 more usage flag
depends_on:MBEDTLS_AES_C:MBEDTLS_CIPHER_MODE_CTR
copy_key_policy:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR:PSA_KEY_TYPE_AES:"404142434445464748494a4b4c4d4e4f":PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR:PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT:PSA_ALG_CTR:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR
Copy key: AES, source=target, constraint with 2 more usage flags
depends_on:MBEDTLS_AES_C:MBEDTLS_CIPHER_MODE_CTR
copy_key_policy:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR:PSA_KEY_TYPE_AES:"404142434445464748494a4b4c4d4e4f":PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR:PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT | PSA_KEY_USAGE_EXPORT:PSA_ALG_CTR:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR
Copy key: AES, source=target, constraint with different usage flags
depends_on:MBEDTLS_AES_C:MBEDTLS_CIPHER_MODE_CTR
copy_key_policy:PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_EXPORT:PSA_ALG_CTR:PSA_KEY_TYPE_AES:"404142434445464748494a4b4c4d4e4f":PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_EXPORT:PSA_ALG_CTR:PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT:PSA_ALG_CTR:PSA_KEY_USAGE_ENCRYPT:PSA_ALG_CTR