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

NULL-check s2n_cert_chain_and_key_get_pkey_type #3064

Merged
merged 1 commit into from
Sep 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crypto/s2n_certificate.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,11 @@ void *s2n_cert_chain_and_key_get_ctx(struct s2n_cert_chain_and_key *cert_and_key

s2n_pkey_type s2n_cert_chain_and_key_get_pkey_type(struct s2n_cert_chain_and_key *chain_and_key)
{
if (chain_and_key == NULL
|| chain_and_key->cert_chain == NULL
|| chain_and_key->cert_chain->head == NULL) {
return S2N_PKEY_TYPE_UNKNOWN;
}
return chain_and_key->cert_chain->head->pkey_type;
}

Expand Down