Remove unused WIP key verification code 07/161607/2 accepted/tizen/unified/20171205.155618 submit/tizen/20171205.074343
authorIgor Kotrasinski <i.kotrasinsk@partner.samsung.com>
Fri, 24 Nov 2017 09:37:35 +0000 (10:37 +0100)
committerTomasz Swierczek <t.swierczek@samsung.com>
Tue, 28 Nov 2017 13:07:14 +0000 (14:07 +0100)
This code is a non-functional WIP that is not used by key-manager. If
needed, we can restore it in the future.

Change-Id: I0e7d1840f7a6695dfb1342915c18a3262d1a71df
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
ta/include/cmd_exec.h
ta/src/cmd_exec.c
ta/src/km_ta.c

index b3de375dbbc9c54aab677d4c46f2bbd31335761b..37856fff511d6d538373c4158387e3b42acc157b 100644 (file)
@@ -38,8 +38,6 @@ TEE_Result KM_ExecCmdAsymmetric(uint32_t commandID, TEE_Param param[4]);
 
 TEE_Result KM_ExecCmdSign(TEE_Param param[4]);
 
-TEE_Result KM_ExecCmdVerify(TEE_Param param[4]);
-
 TEE_Result KM_ExecCmdDestroyKey(TEE_Param param[4]);
 
-#endif // __CMD_EXEC_H__
\ No newline at end of file
+#endif // __CMD_EXEC_H__
index 938eae1d5b10d6d3b75c78392667e69f4ab9f618..a7cc672e38f78144637ce986feeb1ca4ef010236 100644 (file)
@@ -838,71 +838,6 @@ clean:
        return ret;
 }
 
-TEE_Result KM_ExecCmdVerify(TEE_Param param[4])
-{
-       TEE_Result ret = TEE_ERROR_NOT_IMPLEMENTED;
-       TEE_OperationHandle digestOperation = TEE_HANDLE_NULL;
-       TEE_OperationHandle operation = TEE_HANDLE_NULL;
-       KM_SymmetricInput *input = NULL;
-       KM_InputData *input_data = NULL;
-       KM_IVData *iv_data = NULL;
-       KM_KeyId *key_id_data = NULL;
-
-       void* digest = NULL;
-       uint32_t digest_size = 0;
-       uint32_t algo = KM_AlgoHash2SignVerifyAlgo(param[0].value.a, param[0].value.b);
-
-       if (algo == 0) {
-               LOG("Unsupported algorithm provided: %u", algo);
-               return TEE_ERROR_BAD_PARAMETERS;
-       }
-
-       ret = KM_DeserializeInput(param[1].memref.buffer, param[1].memref.size,
-                                                       &input, &input_data, NULL, NULL,
-                                                       &key_id_data, NULL, NULL);
-       if (ret != TEE_SUCCESS) {
-               LOG("Failed to deserialize data from input buffer");
-               return TEE_ERROR_BAD_PARAMETERS;
-       }
-
-       if (!input_data) {
-               LOG("There needs to be InputData!");
-               return TEE_ERROR_BAD_PARAMETERS;
-       }
-
-       ret = KM_CreateDigestOperation(KM_Hash2TeeAlgo(param[0].value.b), &digestOperation);
-       if (TEE_SUCCESS != ret) {
-               LOG("Failed to create digest operation");
-               goto clean;
-       }
-
-       ret = KM_CreateOperationWithKeyId(key_id_data->data, key_id_data->data_size,
-                                                                       TEE_MODE_VERIFY, algo, &operation);
-
-       digest_size = KM_DigestSizeFromHash(param[0].value.b);
-       digest = malloc(digest_size);
-       if (digest == NULL) {
-               LOG("Failed to allocate buffer for digest");
-               ret = TEE_ERROR_OUT_OF_MEMORY;
-               goto clean;
-       }
-
-       ret = KM_Digest(digestOperation, input_data->data, input_data->data_size,
-                                       digest, &digest_size);
-       if (TEE_SUCCESS != ret) {
-               goto clean;
-       }
-
-       ret = KM_AsymmetricVerify(operation, digest, digest_size,
-                                                       iv_data->data, iv_data->data_size);
-
-clean:
-       free(digest);
-       if (digestOperation != TEE_HANDLE_NULL) TEE_FreeOperation(digestOperation);
-       if (operation != TEE_HANDLE_NULL) TEE_FreeOperation(operation);
-       return ret;
-}
-
 TEE_Result KM_ExecCmdDestroyKey(TEE_Param param[4])
 {
        TEE_Result ret = TEE_SUCCESS;
index 98d515fc78949d775e79c06a32714e0e4063112d..48c8cacac6761b8a8c1d573cc29b93b16d543589 100644 (file)
@@ -123,20 +123,6 @@ TEE_Result TA_InvokeCommandEntryPoint(void *sessionContext, uint32_t commandID,
                ret = KM_ExecCmdSign(param);
                break;
        }
-       case CMD_VERIFY: {
-               LOGD("!!! Verify !!!");
-
-               if (ALGO_RSA_SV != param[0].value.a &&
-                       ALGO_DSA_SV != param[0].value.a &&
-                       ALGO_ECDSA_SV != param[0].value.a) {
-                       LOG("Invalid key type=%d for command=%d.", param[0].value.a, commandID);
-                       ret = TEE_ERROR_BAD_PARAMETERS;
-                       break;
-               }
-
-               ret = KM_ExecCmdVerify(param);
-               break;
-       }
        case CMD_DESTROY_KEY: {
                LOGD("!!! Destroy !!!");
                ret = KM_ExecCmdDestroyKey(param);