{"action":"closed","issue":{"url":"https://api.github.com/repos/OP-TEE/optee_os/issues/2268","repository_url":"https://api.github.com/repos/OP-TEE/optee_os","labels_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/2268/labels{/name}","comments_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/2268/comments","events_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/2268/events","html_url":"https://github.com/OP-TEE/optee_os/issues/2268","id":316690382,"number":2268,"title":"The return code of TEE_AsymmetricVerifyDigest() violates GP TEE API spec","user":{"login":"davidhuziji","id":31985963,"avatar_url":"https://avatars0.githubusercontent.com/u/31985963?v=4","gravatar_id":"","url":"https://api.github.com/users/davidhuziji","html_url":"https://github.com/davidhuziji","followers_url":"https://api.github.com/users/davidhuziji/followers","following_url":"https://api.github.com/users/davidhuziji/following{/other_user}","gists_url":"https://api.github.com/users/davidhuziji/gists{/gist_id}","starred_url":"https://api.github.com/users/davidhuziji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidhuziji/subscriptions","organizations_url":"https://api.github.com/users/davidhuziji/orgs","repos_url":"https://api.github.com/users/davidhuziji/repos","events_url":"https://api.github.com/users/davidhuziji/events{/privacy}","received_events_url":"https://api.github.com/users/davidhuziji/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-23T07:18:57Z","updated_at":"2018-04-23T09:29:04Z","closed_at":"2018-04-23T09:29:04Z","author_association":"NONE","body":"Hi,\r\n\r\nAccording to GP TEE internal Core API Specification Section 6.7.3 `TEE_AsymmetricVerifyDigest()`, the return code of `TEE_AsymmetricVerifyDigest()` is described as below.\r\n\r\n> Return Code\r\n>  TEE_SUCCESS: In case of success\r\n>  TEE_ERROR_SIGNATURE_INVALID: If the signature is invalid\r\n\r\nIn OP-TEE, [crypto_acipher_ecc_verify](https://github.com/OP-TEE/optee_os/blob/master/core/lib/libtomcrypt/src/tee_ltc_provider.c#L1689) is called to implement `syscall_asymm_verify()` for ECDSA type.\r\nHowever, the return value of [crypto_acipher_ecc_verify](https://github.com/OP-TEE/optee_os/blob/master/core/lib/libtomcrypt/src/tee_ltc_provider.c#L1689) is only `TEE_SUCCESS` or `TEE_ERROR_GENERIC`. It will never return `TEE_ERROR_SIGNATURE_INVALID`, even if the signature is invalid.\r\nFinally, when the return code comes back to `TEE_AsymmetricVerifyDigest()`, it will always panic with `TEE_ERROR_GENERIC` if the signature verification doesn't succeed. \r\n\r\nAs a result, when `TEE_AsymmetricVerifyDigest` panics, I cannot get any useful information to check if the signature itself is invalid or actually something else triggers the panic.\r\n\r\nCould you please help adjust the return code in [crypto_acipher_ecc_verify](https://github.com/OP-TEE/optee_os/blob/master/core/lib/libtomcrypt/src/tee_ltc_provider.c#L1689) to return a more specific error value?"}}
{"actor":{"display_login":"davidhuziji"}}