How to add support for MCUBoot Image Signature signed with ECC curve secp256k1 created by openSSL ?

Hi, I'm working on nRF52840-DK board and NCS SDK-v1.7.0 on Windows with Visual Studio Code.

We want to add support for Image validation for imaged signed with ECC curve secp256k1 based ECC key. By default, it consider only secp256r1 based EC curve key but not secp256k1.We want to sign the image with sec256k1 EC curve based key.

First we have created private key using below command:
openssl ecparam -genkey -out priv-sec256k1.pem -name secp256k1

Then we have enabled below configuration options in MCUBoot.conf:

CONFIG_MBEDTLS_ECP_ALL_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_CURVE448_ENABLED=y
CONFIG_MBEDTLS_ECP_NIST_OPTIM=y

Then we have given this private key from custom MCUBoot conf file.

During compile time, it takes generated private key but it throws error of "Unsupported EC curve : secp256k1".Therefore Build fails.

How can I add support for OpenSSL generated ECC curve secp256k1 based signature key ?

Related