diff --git a/src/common/dpp_crypto.c b/src/common/dpp_crypto.c index f17f95a2c..08143e46a 100644 --- a/src/common/dpp_crypto.c +++ b/src/common/dpp_crypto.c @@ -269,6 +269,12 @@ int dpp_get_pubkey_hash(struct crypto_ec_key *key, u8 *hash) struct crypto_ec_key * dpp_gen_keypair(const struct dpp_curve_params *curve) { + if (curve == NULL) { + wpa_printf(MSG_DEBUG, + "DPP: %s curve must be initialized", __func__); + return NULL; + } + struct crypto_ec_key *key; wpa_printf(MSG_DEBUG, "DPP: Generating a keypair"); diff --git a/src/common/sae.c b/src/common/sae.c index 358485588..3e66b0b8b 100644 --- a/src/common/sae.c +++ b/src/common/sae.c @@ -1279,6 +1279,13 @@ void sae_deinit_pt(struct sae_pt *pt) static int sae_derive_commit_element_ecc(struct sae_data *sae, struct crypto_bignum *mask) { + if (sae->tmp->pwe_ecc == NULL) { + wpa_printf(MSG_DEBUG, + "SAE: %s sae->tmp->pwe_ecc must be initialized", + __func__); + return -1; + } + /* COMMIT-ELEMENT = inverse(scalar-op(mask, PWE)) */ if (!sae->tmp->own_commit_element_ecc) { sae->tmp->own_commit_element_ecc =