From: Dongsun Lee Date: Wed, 16 Aug 2023 00:57:43 +0000 (+0900) Subject: Use GP 1.1.0 EDCH algorithm names X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd852bb3aa43af9994afc2118f7ba60d3fa15e8b;p=platform%2Fcore%2Fsecurity%2Ftef-simulator.git Use GP 1.1.0 EDCH algorithm names - Use TEE_ALG_ECDH_PXXX(1.1.0) instead of TEE_ALG_ECDH_DERIVE_SHARED_SECRET(v1.1.1) Change-Id: Iea77df5984248873f52949a2f04034c2ca47a8d0 --- diff --git a/ssflib/src/ssf_crypto.cpp b/ssflib/src/ssf_crypto.cpp index 92c948b..7a1a8ec 100644 --- a/ssflib/src/ssf_crypto.cpp +++ b/ssflib/src/ssf_crypto.cpp @@ -939,7 +939,6 @@ int crypto_internal_open(crypto_internal_operation *operation) case TEE_ALG_ECDH_P256: case TEE_ALG_ECDH_P384: case TEE_ALG_ECDH_P521: - case TEE_ALG_ECDH_DERIVE_SHARED_SECRET: return 0; // do nothing default: return sw_crypto_open(operation); @@ -964,7 +963,6 @@ int crypto_internal_close(crypto_internal_operation *operation) case TEE_ALG_ECDH_P256: case TEE_ALG_ECDH_P384: case TEE_ALG_ECDH_P521: - case TEE_ALG_ECDH_DERIVE_SHARED_SECRET: return 0; // do nothing default: return sw_crypto_close(operation); @@ -1773,15 +1771,12 @@ TEE_Result TEE_AllocateOperation(TEE_OperationHandle *operation, uint32_t algori case TEE_ALG_ECDH_P256: case TEE_ALG_ECDH_P384: case TEE_ALG_ECDH_P521: - if (mode != TEE_MODE_SIGN && mode != TEE_MODE_VERIFY) { + if (mode != TEE_MODE_DERIVE) { return TEE_ERROR_NOT_SUPPORTED; } - alg_class = TEE_OPERATION_ASYMMETRIC_SIGNATURE; - if (mode == TEE_MODE_SIGN) - key_object_type = TEE_TYPE_ECDH_KEYPAIR; - else - key_object_type = TEE_TYPE_ECDH_KEYPAIR; + alg_class = TEE_OPERATION_KEY_DERIVATION; + key_object_type = TEE_TYPE_ECDH_KEYPAIR; break; /* Algorithm Class is KEY DERIVATION */ @@ -1794,15 +1789,6 @@ TEE_Result TEE_AllocateOperation(TEE_OperationHandle *operation, uint32_t algori key_object_type = TEE_TYPE_DH_KEYPAIR; break; - case TEE_ALG_ECDH_DERIVE_SHARED_SECRET: - if (mode != TEE_MODE_DERIVE) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_KEY_DERIVATION; - key_object_type = TEE_TYPE_ECDH_KEYPAIR; - break; - default: LOGE(MODULE_SSF_LIB, "Not Support Algorithm : %X", algorithm); rc = TEE_ERROR_NOT_SUPPORTED; @@ -2891,7 +2877,7 @@ TEE_Result TEE_AsymmetricVerifyDigest( TEE_OperationHandle operation, const TEE_ } } -// Only TEE_ALG_ECDH_DERIVE_SHARED_SECRET supported for now. +// Only TEE_ALG_ECDH_PXXX supported for now. void TEE_DeriveKey( TEE_OperationHandle operation, TEE_Attribute* params, uint32_t paramCount, TEE_ObjectHandle derivedKey) { PERMISSION_CHECK_RETURN_VOID(PERM_CRYPTO);