Skip to content

Commit 577f60d

Browse files
kaabiajhedberg
authored andcommitted
crypto: mbedtls_shim: Remove incorrect out_len calculation in AEAD decrypt
Remove erroneous calculation of `apkt->pkt->out_len` in `mtls_ccm_decrypt_auth` and `mtls_gcm_decrypt_auth`. The output length should be handled by the caller or the AEAD decryption process itself. Signed-off-by: Badr Bacem KAABIA <[email protected]>
1 parent 01b0280 commit 577f60d

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

drivers/crypto/crypto_mtls_shim.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,6 @@ static int mtls_ccm_decrypt_auth(struct cipher_ctx *ctx,
231231
return -EINVAL;
232232
}
233233

234-
apkt->pkt->out_len = apkt->pkt->in_len;
235-
apkt->pkt->out_len += ctx->mode_params.ccm_info.tag_len;
236-
237234
return 0;
238235
}
239236

@@ -290,9 +287,6 @@ static int mtls_gcm_decrypt_auth(struct cipher_ctx *ctx,
290287
return -EINVAL;
291288
}
292289

293-
apkt->pkt->out_len = apkt->pkt->in_len;
294-
apkt->pkt->out_len += ctx->mode_params.gcm_info.tag_len;
295-
296290
return 0;
297291
}
298292
#endif /* CONFIG_MBEDTLS_CIPHER_GCM_ENABLED */

0 commit comments

Comments
 (0)