-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
swtpm: Return TPM_FAIL if SWTPM_NVRAM_DecrytpData is called without key
Return TPM_FAIL if SWTPM_NVRAM_DecryptData() is called without a key or if an unhandle type of encryption mode is encountered. Previously this function would return no error but also would not do any decryption if no key was provided. Consequently, it would then also not return a byte array with decrypted data which in turn could led to potential NULL pointer accesses in subsequent calls. However, all current callers check whether they have a valid key before they call this function. So the change is primarily done for static analyzers, such as gcc -fanalyzer, to ease code analysis. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
- Loading branch information
1 parent
c94a1c4
commit 7d79ecd
Showing
1 changed file
with
54 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters