Skip to content

HKDF infinite loop bug #356

@david-koenig

Description

@david-koenig

https://github.com/awslabs/aws-encryption-sdk-c/blob/bf26105520772b1b6ac486d978c1325bd13f5a6f/source/hkdf.c#L79-L81

If n has the maximum value of 255, the comparison idx <= n is always true, since idx is a uint8_t, so the loop will never terminate. One way to fix is to make idx an int and assign its value to a uint8_t inside the loop.

Fix should include a test that it works properly when the full 255 hash blocks are needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions