3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

dpp: check return of aes_siv_encrypt

This was caught by static analysis. As is common this should never
happen in the real world since the only way this can fail (apart from
extreme circumstances like OOM) is if the key size is incorrect, which
it will never be.
This commit is contained in:
James Prestwood 2022-02-18 11:55:06 -08:00 committed by Denis Kenzior
parent 5ca7948dfb
commit c819903a7c

View File

@ -1036,8 +1036,11 @@ static void send_authenticate_response(struct dpp_sm *dpp)
* do not use AAD; in other words, the number of AAD components is set * do not use AAD; in other words, the number of AAD components is set
* to zero."" * to zero.""
*/ */
aes_siv_encrypt(dpp->ke, dpp->key_len, wrapped2_plaintext, if (!aes_siv_encrypt(dpp->ke, dpp->key_len, wrapped2_plaintext,
dpp->key_len + 4, NULL, 0, wrapped2); dpp->key_len + 4, NULL, 0, wrapped2)) {
l_error("Failed to encrypt wrapped data");
return;
}
wrapped2_len += 16; wrapped2_len += 16;