Skip to content

Commit

Permalink
[dice] remove unused cert_size output parameter in dice_cert_check_valid
Browse files Browse the repository at this point in the history
This removes the unused `cert_size` output parameter in the
`dice_cert_check_valid` function.

Also, the original implementation caused a clang compiler error due to
incompatible pointer types by passing `&cert_size` (size_t *) to the
`cert_x509_asn1_check_serial_number` function (expects a uint32_t * type).

Signed-off-by: Anthony Chen <[email protected]>
  • Loading branch information
anthonychen1251 committed Feb 3, 2025
1 parent 78f1dc3 commit 58e6fca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sw/device/silicon_creator/lib/cert/dice.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ rom_error_t dice_cert_check_valid(const perso_tlv_cert_obj_t *cert_obj,
// For X.509, we only check the serial_number but not public key contents.
OT_DISCARD(pubkey);

size_t cert_size = cert_obj->cert_body_size;
return cert_x509_asn1_check_serial_number(cert_obj->cert_body_p, 0,
(uint8_t *)pubkey_id->digest,
cert_valid_output, &cert_size);
return cert_x509_asn1_check_serial_number(
cert_obj->cert_body_p, 0, (uint8_t *)pubkey_id->digest, cert_valid_output,
/*out_cert_size=*/NULL);
}

0 comments on commit 58e6fca

Please sign in to comment.