Home GnuPG
Diffusion GnuPG d631c8198c25

tpm: Improve error handling and check returned lengths.

Description

tpm: Improve error handling and check returned lengths.

* tpm2d/command.c (cmd_pkdecrypt): Handle unknown algo.  Also slightly
rework error handling.
* tpm2d/tpm2.c (sexp_to_tpm2_public_ecc): Check length before checking
for 0x04.  Rework error handling.
(tpm2_ObjectPublic_GetName): Check the return value of
TSS_GetDigestSize before use.  Erro handling rework.
(tpm2_SensitiveToDuplicate): Ditto.
(tpm2_import_key): Ditto.
* tpm2d/intel-tss.h (TSS_Hash_Generate): Check passed length for
negative values.  Check return value of TSS_GetDigestSize.  Use
dedicated 16 bit length variable.

These are reworked and improved fixes as reported in

Details

Provenance
wernerAuthored on May 28 2024, 12:45 PM
Parents
rG2e4b1f785055: tpm: Do not use fprintf for logging.
Branches
Unknown
Tags
Unknown
Tasks
T7129: Fix static reports by static analyser in gnugp