Skip to content

CF_HASH_MAXBLK too low for HMAC-SHA3 #14

@zerynth

Description

@zerynth

Hello and kudos for the awesome project.

While investigating a bug report in our platform we think we have found a bug in the hmac implementation.

cf_hmac_init uses temporary buffers k and blk that are initialized at a size of CF_CHASH_MAXBLK=128. However, the block sizes for sha3-224 and sha3-256 are 144 and 136, causing a buffer overflow on the memset at hmac.c:53

A simple fix is setting CF_CHASH_MAXBLK at 144

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions