From ce4c08a3001b1cf030d11dee0a6e24a4e60efb85 Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Tue, 24 Sep 2024 12:35:32 +0900 Subject: [PATCH] Check if ckmc_get_data() provides NULL value There are cases where ckmc_get_data() provides NULL value due to a DB issue used by key-manager. This causes passphrase decryption to fail and causes wifi connection failure. Code has been added to check for this situation. Change-Id: Ic79efcc26efa33251771bf7757ddda5ef600f895 Signed-off-by: Jaehyun Kim --- src/wifi-key-encryption.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wifi-key-encryption.c b/src/wifi-key-encryption.c index 33c8f5a..6268cb4 100755 --- a/src/wifi-key-encryption.c +++ b/src/wifi-key-encryption.c @@ -127,6 +127,11 @@ static void* __netconfig_set_param_list_aes_gcm(ckmc_param_list_h param) err = ckmc_get_data(IV_ALIAS, NULL, &iv_buf); + if (iv_buf == NULL) { + DBG("iv_buf is null"); + return NULL; + } + if (err == CKMC_ERROR_DB_ALIAS_UNKNOWN) { ckmc_policy_s policy; policy.extractable = true; -- 2.34.1