Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Coverity CID :206600] Logically dead code in drivers/crypto/crypto_mtls_shim.c #21701

Closed
zephyrbot opened this issue Jan 4, 2020 · 1 comment · Fixed by #23326
Closed

[Coverity CID :206600] Logically dead code in drivers/crypto/crypto_mtls_shim.c #21701

zephyrbot opened this issue Jan 4, 2020 · 1 comment · Fixed by #23326
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/c9a2a5e7fb0194bfb168f5aa1a0a83c73f62acb3/drivers/crypto/crypto_mtls_shim.c#L267

Category: Control flow issues
Function: mtls_session_setup
Component: Drivers
CID: 206600

Details:

261                 LOG_ERR("AES_ECB: failed at setkey (%d)", ret);
262                 ctx->ops.block_crypt_hndlr = NULL;
263                 mtls_sessions[ctx_idx].in_use = false;
264                 return -EINVAL;
265             }
266             break;
>>>     CID 206600:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "case CRYPTO_CIPHER_MODE_CTR:".
267         case CRYPTO_CIPHER_MODE_CTR:
268             break;
269         case CRYPTO_CIPHER_MODE_CBC:
270             aes_ctx = &mtls_sessions[ctx_idx].mtls_aes;
271             mbedtls_aes_init(aes_ctx);
272             if (op_type == CRYPTO_CIPHER_OP_ENCRYPT) {

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v32951/p12996.

Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the CODEOWNERS file.

@zephyrbot zephyrbot added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug labels Jan 4, 2020
@ceolin ceolin self-assigned this Mar 6, 2020
@nashif
Copy link
Member

nashif commented Mar 11, 2020

Fixed by #23326

@nashif nashif closed this as completed Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants