Skip to content

Remove unused salt buffer from ltc_pkcs_1_pss_decode_mgf1 #796

Description

@headscott

ltc_pkcs_1_pss_decode_mgf1 allocates a separate buffer for salt:

unsigned char *DB, *mask, *salt, *hash;
[...]
salt = XMALLOC(modulus_len);

However, the salt buffer is never written to or read from. The salt is already available directly within DB and is passed to the hash function using:

hash_descriptor[op_checked.hash_alg].process(&md, DB+x, saltlen)

At this point, DB + x points to the beginning of the salt portion of DB.

Suggested Fix:

Remove the unused salt buffer and all associated allocation, cleanup, and deallocation code.
The PSS verification logic itself does not need to change, as the salt can continue to be processed directly from DB + x.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions