Skip to content

Update atcacert_host_sw.c #404

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/atcacert/atcacert_host_sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down