Skip to content

Context too short in crypto_kdf_derive_from_key #1

@goblin

Description

@goblin

The "rxtx" used as ctx argument to crypto_kdf_derive_from_key is too short of a string. It should be exactly 8 bytes. I was using a code search on github and found it in 2 occurrences in your code:

crypto_kdf_derive_from_key((uint8_t *) key, secretbox :: key :: size, (this->_lesser ? 0 : 1), "rxtx", this->_bytes);

and
crypto_kdf_derive_from_key((uint8_t *) key, secretbox :: key :: size, (this->_lesser ? 1 : 0), "rxtx", this->_bytes);

I've raised an issue with libsodium that this interface is indeed very prone to errors.

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