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

Clean up minor x.509 issues #2930

Merged
merged 1 commit into from
Dec 18, 2024
Merged

Clean up minor x.509 issues #2930

merged 1 commit into from
Dec 18, 2024

Conversation

steven-bellock
Copy link
Contributor

  • Add explicit NULL check.
  • Fix typos.
  • Make documentation and implementation consistent.

- Add explicit NULL check.
- Fix typos.
- Make documentation and implementation consistent.

Signed-off-by: Steven Bellock <[email protected]>
@steven-bellock steven-bellock added documentation Improvements or additions to documentation refactor Should not affect functionality labels Dec 12, 2024
@steven-bellock
Copy link
Contributor Author

These issues were found by the NVIDIA CI/CD system.

@steven-bellock steven-bellock marked this pull request as ready for review December 12, 2024 17:57
Comment on lines +207 to +212
if (x509_cert == NULL) {
return;
}

mbedtls_x509_crt_free(x509_cert);
free_pool(x509_cert);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the change.

What is the problem of original code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The codebase uses explicit NULL checks instead of treating the pointer as a boolean. In addition mbedtls_x509_crt_free does not specify that x509_cert can be NULL, and so the function explicitly returns early.

@jyao1 jyao1 merged commit 5d5dd82 into DMTF:main Dec 18, 2024
97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation refactor Should not affect functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants