Commit 186ac885 authored by Roland Mikhel's avatar Roland Mikhel Committed by Dávid Vincze
Browse files

bootutil: Fix FIH return type for EC256



For bootutil_verify_sig the declaration expects fih_ret
as the return type not fih_int, this has now been fixed.

Signed-off-by: default avatarRoland Mikhel <roland.mikhel@arm.com>
Change-Id: If5943758bebdbf401b1eb387de334fa19a3a7781
parent 5397c13d
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@
#include "bootutil/fault_injection_hardening.h"
#include "bootutil/crypto/ecdsa_p256.h"

fih_int
fih_ret
bootutil_verify_sig(uint8_t *hash, uint32_t hlen, uint8_t *sig, size_t slen,
                    uint8_t key_id)
{
@@ -51,11 +51,16 @@ bootutil_verify_sig(uint8_t *hash, uint32_t hlen, uint8_t *sig, size_t slen,

    rc = bootutil_ecdsa_p256_parse_public_key(&ctx, &pubkey, end);
    if (rc) {
        goto out;
    }

    rc = bootutil_ecdsa_p256_verify(&ctx, pubkey, end-pubkey, hash, hlen, sig, slen);
    fih_rc = fih_ret_encode_zero_equality(rc);
    if (FIH_NOT_EQ(fih_rc, FIH_SUCCESS)) {
        FIH_SET(fih_rc, FIH_FAILURE);
        FIH_RET(fih_rc);
    }

    FIH_CALL(bootutil_ecdsa_p256_verify, fih_rc, &ctx, pubkey, end-pubkey, hash, hlen, sig, slen);
out:
    bootutil_ecdsa_p256_drop(&ctx);

    FIH_RET(fih_rc);