From 11b8f1e6e1d52e36b77f3a5f2aebdf01a7411df2 Mon Sep 17 00:00:00 2001 From: Vincent Thivent Date: Mon, 26 May 2025 20:35:37 +0200 Subject: [PATCH] Update atcacert_host_sw.c Problem Solving : size of "ca_public_key->len" ATCA_PUB_KEY_SIZE = 0 to ATCA_PUB_KEY_SIZE = 64 And improvement with the new format : tbs_digest => dig.buf sizeof(tbs_digest) => dig.len signature => sig.buf --- lib/atcacert/atcacert_host_sw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/atcacert/atcacert_host_sw.c b/lib/atcacert/atcacert_host_sw.c index 26752d3a..021f863f 100644 --- a/lib/atcacert/atcacert_host_sw.c +++ b/lib/atcacert/atcacert_host_sw.c @@ -53,7 +53,7 @@ ATCA_STATUS atcacert_verify_cert_sw(const atcacert_def_t* cert_def, switch(ca_public_key->len) { - case ATCA_KEY_TYPE_ECCP256: + case ATCA_SHA2_256_DIGEST_SIZE: dig.len = ATCA_SHA2_256_DIGEST_SIZE; break; #if ATCA_TA_SUPPORT @@ -94,7 +94,7 @@ ATCA_STATUS atcacert_verify_cert_sw(const atcacert_def_t* cert_def, } /* Perform the verification */ - ret = atcac_pk_verify(&pkey_ctx, tbs_digest, sizeof(tbs_digest), signature, sig.len); + ret = atcac_pk_verify(&pkey_ctx, dig.buf, dig.len, sig.buf, sig.len); /* Make sure to free the key before testing the result of the verify */ (void)atcac_pk_free(&pkey_ctx);