Translate invalid AES key size error 33/299133/1
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 20 Sep 2023 10:00:20 +0000 (12:00 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 20 Sep 2023 10:00:20 +0000 (12:00 +0200)
According to GP API when incorrect key size is given the
TEE_ERROR_NOT_SUPPORTED is returned but key-manager expects
TEE_ERROR_BAD_PARAMETERS in such case.

Change-Id: I06a61680a5d134eb92a2b0b4ee6f80580c14c023

ta/src/cmd_exec.c

index bb0847154268125052357f1e7e00fad1368fadd1..f7dac3bfada560e28295ea6b70e7897bc639b602 100644 (file)
@@ -1602,6 +1602,8 @@ TEE_Result KM_ExecCmdImportWrappedKey(TEE_Param param[4])
                ret = KM_CreateKey(tee_enc_key_type, ekey_data.data_size * 8, ekey_data.data, &key);
        }
        if (ret != TEE_SUCCESS) {
+               if (ret == TEE_ERROR_NOT_SUPPORTED)
+                       ret = TEE_ERROR_BAD_PARAMETERS;
                LOG("Failed to create key");
                goto clean;
        }