From 8e2c104fa148c02da21fd87712a697ba6522a8b4 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 25 Nov 2009 00:57:00 +0200 Subject: [PATCH] Resolve some sparse warnings Mainly, this is including header files to get definitions for functions which is good to verify that the parameters match. None of these are issues that would have shown as incorrect behavior of the program. --- src/crypto/aes-cbc.c | 1 + src/crypto/aes-ctr.c | 1 + src/crypto/aes-encblock.c | 1 + src/crypto/aes-omac1.c | 1 + src/crypto/aes-unwrap.c | 1 + src/crypto/crypto_openssl.c | 1 + src/drivers/driver_nl80211.c | 2 +- src/wps/ndef.c | 1 + src/wps/wps_registrar.c | 2 +- src/wps/wps_ufd.c | 1 + 10 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/crypto/aes-cbc.c b/src/crypto/aes-cbc.c index 4e4cd7f91..bd7476990 100644 --- a/src/crypto/aes-cbc.c +++ b/src/crypto/aes-cbc.c @@ -17,6 +17,7 @@ #include "common.h" #include "aes.h" +#include "aes_wrap.h" /** * aes_128_cbc_encrypt - AES-128 CBC encryption diff --git a/src/crypto/aes-ctr.c b/src/crypto/aes-ctr.c index 997f4282b..468f87741 100644 --- a/src/crypto/aes-ctr.c +++ b/src/crypto/aes-ctr.c @@ -17,6 +17,7 @@ #include "common.h" #include "aes.h" +#include "aes_wrap.h" /** * aes_128_ctr_encrypt - AES-128 CTR mode encryption diff --git a/src/crypto/aes-encblock.c b/src/crypto/aes-encblock.c index a1d56f54f..8f35caa22 100644 --- a/src/crypto/aes-encblock.c +++ b/src/crypto/aes-encblock.c @@ -17,6 +17,7 @@ #include "common.h" #include "aes.h" +#include "aes_wrap.h" /** * aes_128_encrypt_block - Perform one AES 128-bit block operation diff --git a/src/crypto/aes-omac1.c b/src/crypto/aes-omac1.c index d9712b520..f77529617 100644 --- a/src/crypto/aes-omac1.c +++ b/src/crypto/aes-omac1.c @@ -17,6 +17,7 @@ #include "common.h" #include "aes.h" +#include "aes_wrap.h" static void gf_mulx(u8 *pad) { diff --git a/src/crypto/aes-unwrap.c b/src/crypto/aes-unwrap.c index afaa47a28..f233ffa4c 100644 --- a/src/crypto/aes-unwrap.c +++ b/src/crypto/aes-unwrap.c @@ -17,6 +17,7 @@ #include "common.h" #include "aes.h" +#include "aes_wrap.h" /** * aes_unwrap - Unwrap key with AES Key Wrap Algorithm (128-bit KEK) (RFC3394) diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c index 93d7b59ad..e1fcf471c 100644 --- a/src/crypto/crypto_openssl.c +++ b/src/crypto/crypto_openssl.c @@ -23,6 +23,7 @@ #include "common.h" #include "wpabuf.h" +#include "dh_group5.h" #include "crypto.h" #if OPENSSL_VERSION_NUMBER < 0x00907000 diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 129bf0928..ad279a19d 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -1701,7 +1701,7 @@ wpa_driver_nl80211_get_scan_results(void *priv) res = os_zalloc(sizeof(*res)); if (res == NULL) - return 0; + return NULL; msg = nlmsg_alloc(); if (!msg) goto nla_put_failure; diff --git a/src/wps/ndef.c b/src/wps/ndef.c index f900767b5..9baec7f4b 100644 --- a/src/wps/ndef.c +++ b/src/wps/ndef.c @@ -16,6 +16,7 @@ #include "includes.h" #include "common.h" #include "wps/wps.h" +#include "wps/wps_i.h" #define FLAG_MESSAGE_BEGIN (1 << 7) #define FLAG_MESSAGE_END (1 << 6) diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c index edd4b5abf..2dad278ae 100644 --- a/src/wps/wps_registrar.c +++ b/src/wps/wps_registrar.c @@ -1139,7 +1139,7 @@ static int wps_build_cred_encr_type(struct wpabuf *msg, static int wps_build_cred_network_key(struct wpabuf *msg, - const const struct wps_credential *cred) + const struct wps_credential *cred) { wpa_printf(MSG_DEBUG, "WPS: * Network Key"); wpabuf_put_be16(msg, ATTR_NETWORK_KEY); diff --git a/src/wps/wps_ufd.c b/src/wps/wps_ufd.c index 0e713eeee..1a911e1d4 100644 --- a/src/wps/wps_ufd.c +++ b/src/wps/wps_ufd.c @@ -21,6 +21,7 @@ #include #include "wps/wps.h" +#include "wps/wps_i.h" #ifdef CONFIG_NATIVE_WINDOWS #define UFD_DIR1 "%s\\SMRTNTKY"