Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swtpm: Return TPM_FAIL if SWTPM_NVRAM_DecrytpData is called without key #760

Merged
merged 1 commit into from
Sep 30, 2022

Conversation

stefanberger
Copy link
Owner

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

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>
@stefanberger stefanberger merged commit 7d79ecd into master Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant