Skip to content

Compilation issues with mbedtls_x509write_crt_set_key_identifier due to conditional dependency on MBEDTLS_MD_CAN_SHA1 #10096

Open
@PragatiGarg-eaton

Description

@PragatiGarg-eaton

Description: Under the file modules/crypto/mbedtls/library/x509write_crt.c, the function mbedtls_x509write_crt_set_key_identifier is conditionally included based on the configuration MBEDTLS_MD_CAN_SHA1. When attempting to disable the vulnerable cipher MBEDTLS_MD_CAN_SHA1, I encountered compilation issues because I need to use the mbedtls_x509write_crt_set_key_identifier function to generate certificates.

Steps to Reproduce:
Disable the configuration MBEDTLS_MD_CAN_SHA1.
Attempt to compile the code that uses mbedtls_x509write_crt_set_key_identifier.
Expected Behavior: The code should compile successfully without requiring MBEDTLS_MD_CAN_SHA1.

Actual Behavior: Compilation fails due to the conditional dependency on MBEDTLS_MD_CAN_SHA1.

Questions:
Why is there a dependency on MBEDTLS_MD_CAN_SHA1 for the mbedtls_x509write_crt_set_key_identifier function?
How can this issue be resolved to allow the use of mbedtls_x509write_crt_set_key_identifier without enabling MBEDTLS_SHA1_C?

Additional Information:
Zephyr version: 3.6.0
MbedTLS version: 3.5.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Status

    Design needed

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions