2005-12-12 Robert Love <rml@novell.com>
* libnm-util/cipher-wep-passphrase.c, libnm-util/cipher-wpa-psk-passphrase.c, src/NetworkManagerAP.c, src/NetworkManagerAP.h, src/NetworkManagerDevice.c, src/NetworkManagerWireless.c, src/NetworkManagerWireless.h: Treat all WEP/WPA keys as "char *" and not explicitly signed or unsigned. When handling keys, we don't care what the sign is. The compiler guarantees us that we get our 8-bits, which is all we care about. * configure.in: Remove "-Wno-pointer-sign" flag. We are sign-aware! git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1172 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
14
ChangeLog
14
ChangeLog
@@ -1,4 +1,16 @@
|
|||||||
2005-12-11 Dan Williams <dcbw@redhat.com>
|
2005-12-12 Robert Love <rml@novell.com>
|
||||||
|
|
||||||
|
* libnm-util/cipher-wep-passphrase.c,
|
||||||
|
libnm-util/cipher-wpa-psk-passphrase.c, src/NetworkManagerAP.c,
|
||||||
|
src/NetworkManagerAP.h, src/NetworkManagerDevice.c,
|
||||||
|
src/NetworkManagerWireless.c, src/NetworkManagerWireless.h: Treat
|
||||||
|
all WEP/WPA keys as "char *" and not explicitly signed or unsigned.
|
||||||
|
When handling keys, we don't care what the sign is. The compiler
|
||||||
|
guarantees us that we get our 8-bits, which is all we care about.
|
||||||
|
* configure.in: Remove "-Wno-pointer-sign" flag. We are sign-aware!
|
||||||
|
|
||||||
|
|
||||||
|
2005-12-12 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
* gnome/applet/applet-dbus-devices.[ch]
|
* gnome/applet/applet-dbus-devices.[ch]
|
||||||
gnome/applet/applet.c
|
gnome/applet/applet.c
|
||||||
|
@@ -260,10 +260,9 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
|
|||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
|
CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
|
||||||
|
|
||||||
for option in -Wno-unused -Wno-sign-compare -Wno-pointer-sign \
|
for option in -Wno-unused -Wno-sign-compare -Wno-strict-aliasing \
|
||||||
-Wdeclaration-after-statement -Wstrict-prototypes \
|
-Wdeclaration-after-statement -Wstrict-prototypes \
|
||||||
-Wmissing-prototypes -Wmissing-declarations \
|
-Wmissing-prototypes -Wmissing-declarations; do
|
||||||
-Wno-strict-aliasing; do
|
|
||||||
SAVE_CFLAGS="$CFLAGS"
|
SAVE_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS $option"
|
CFLAGS="$CFLAGS $option"
|
||||||
AC_MSG_CHECKING([whether gcc understands $option])
|
AC_MSG_CHECKING([whether gcc understands $option])
|
||||||
|
@@ -50,7 +50,7 @@ static char * cipher_wep64_passphrase_hash_func (IEEE_802_11_Cipher *cipher, con
|
|||||||
static char * cipher_wep_passphrase_ascii_to_hex (const unsigned char *ascii, int req_keylen)
|
static char * cipher_wep_passphrase_ascii_to_hex (const unsigned char *ascii, int req_keylen)
|
||||||
{
|
{
|
||||||
static char hex_digits[] = "0123456789abcdef";
|
static char hex_digits[] = "0123456789abcdef";
|
||||||
unsigned char *res;
|
char *res;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
g_return_val_if_fail (ascii != NULL, NULL);
|
g_return_val_if_fail (ascii != NULL, NULL);
|
||||||
|
@@ -59,7 +59,7 @@ static char * cipher_wpa_psk_passphrase_hash_func (IEEE_802_11_Cipher *cipher, c
|
|||||||
g_return_val_if_fail (ssid_len > 0, NULL);
|
g_return_val_if_fail (ssid_len > 0, NULL);
|
||||||
|
|
||||||
buf = g_malloc0 (WPA_PMK_LEN * 2);
|
buf = g_malloc0 (WPA_PMK_LEN * 2);
|
||||||
pbkdf2_sha1 (input, (char *) ssid, ssid_len, 4096, buf, WPA_PMK_LEN);
|
pbkdf2_sha1 (input, (char *) ssid, ssid_len, 4096, (unsigned char *) buf, WPA_PMK_LEN);
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
@@ -659,7 +659,7 @@ const guint8 * nm_ap_get_wpa_ie (NMAccessPoint *ap, guint32 *length)
|
|||||||
return ap->wpa_ie;
|
return ap->wpa_ie;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nm_ap_set_wpa_ie (NMAccessPoint *ap, const guint8 *wpa_ie, guint32 length)
|
void nm_ap_set_wpa_ie (NMAccessPoint *ap, const char *wpa_ie, guint32 length)
|
||||||
{
|
{
|
||||||
g_return_if_fail (ap != NULL);
|
g_return_if_fail (ap != NULL);
|
||||||
|
|
||||||
@@ -690,7 +690,7 @@ const guint8 * nm_ap_get_rsn_ie (NMAccessPoint *ap, guint32 *length)
|
|||||||
return ap->rsn_ie;
|
return ap->rsn_ie;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nm_ap_set_rsn_ie (NMAccessPoint *ap, const guint8 *rsn_ie, guint32 length)
|
void nm_ap_set_rsn_ie (NMAccessPoint *ap, const char *rsn_ie, guint32 length)
|
||||||
{
|
{
|
||||||
g_return_if_fail (ap != NULL);
|
g_return_if_fail (ap != NULL);
|
||||||
|
|
||||||
|
@@ -95,10 +95,10 @@ gboolean nm_ap_is_enc_key_valid (NMAccessPoint *ap);
|
|||||||
gboolean nm_is_enc_key_valid (const char *key, NMEncKeyType key_type);
|
gboolean nm_is_enc_key_valid (const char *key, NMEncKeyType key_type);
|
||||||
|
|
||||||
const guint8 * nm_ap_get_wpa_ie (NMAccessPoint *ap, guint32 *length);
|
const guint8 * nm_ap_get_wpa_ie (NMAccessPoint *ap, guint32 *length);
|
||||||
void nm_ap_set_wpa_ie (NMAccessPoint *ap, const guint8 *wpa_ie, guint32 length);
|
void nm_ap_set_wpa_ie (NMAccessPoint *ap, const char *wpa_ie, guint32 length);
|
||||||
|
|
||||||
const guint8 * nm_ap_get_rsn_ie (NMAccessPoint *ap, guint32 *length);
|
const guint8 * nm_ap_get_rsn_ie (NMAccessPoint *ap, guint32 *length);
|
||||||
void nm_ap_set_rsn_ie (NMAccessPoint *ap, const guint8 *rsn_ie, guint32 length);
|
void nm_ap_set_rsn_ie (NMAccessPoint *ap, const char *rsn_ie, guint32 length);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE:
|
* NOTE:
|
||||||
|
@@ -4450,11 +4450,11 @@ static int hex2byte(const char *hex)
|
|||||||
return (a << 4) | b;
|
return (a << 4) | b;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hexstr2bin(const char *hex, u8 *buf, size_t len)
|
static int hexstr2bin(const char *hex, char *buf, size_t len)
|
||||||
{
|
{
|
||||||
int i, a;
|
int i, a;
|
||||||
const char *ipos = hex;
|
const char *ipos = hex;
|
||||||
u8 *opos = buf;
|
char *opos = buf;
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
a = hex2byte(ipos);
|
a = hex2byte(ipos);
|
||||||
|
@@ -40,10 +40,10 @@
|
|||||||
* Convert an ASCII string into a suitable WEP key.
|
* Convert an ASCII string into a suitable WEP key.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char *nm_wireless_64bit_ascii_to_hex (const unsigned char *ascii)
|
char *nm_wireless_64bit_ascii_to_hex (const char *ascii)
|
||||||
{
|
{
|
||||||
static char hex_digits[] = "0123456789abcdef";
|
static char hex_digits[] = "0123456789abcdef";
|
||||||
unsigned char *res;
|
char *res;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
res = g_malloc (33);
|
res = g_malloc (33);
|
||||||
@@ -69,10 +69,10 @@ char *nm_wireless_64bit_ascii_to_hex (const unsigned char *ascii)
|
|||||||
* copyright Red Hat, Inc. under terms of the LGPL.
|
* copyright Red Hat, Inc. under terms of the LGPL.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char *nm_wireless_128bit_ascii_to_hex (const unsigned char *ascii)
|
char *nm_wireless_128bit_ascii_to_hex (const char *ascii)
|
||||||
{
|
{
|
||||||
static char hex_digits[] = "0123456789abcdef";
|
static char hex_digits[] = "0123456789abcdef";
|
||||||
unsigned char *res;
|
char *res;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
res = g_malloc (33);
|
res = g_malloc (33);
|
||||||
@@ -98,7 +98,7 @@ char *nm_wireless_128bit_ascii_to_hex (const unsigned char *ascii)
|
|||||||
char *nm_wireless_128bit_key_from_passphrase (const char *passphrase)
|
char *nm_wireless_128bit_key_from_passphrase (const char *passphrase)
|
||||||
{
|
{
|
||||||
char md5_data[65];
|
char md5_data[65];
|
||||||
unsigned char digest[16];
|
char digest[16];
|
||||||
int passphrase_len;
|
int passphrase_len;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@@ -28,8 +28,8 @@
|
|||||||
#include "NetworkManagerAPList.h"
|
#include "NetworkManagerAPList.h"
|
||||||
|
|
||||||
|
|
||||||
char * nm_wireless_64bit_ascii_to_hex (const unsigned char *ascii);
|
char * nm_wireless_64bit_ascii_to_hex (const char *ascii);
|
||||||
char * nm_wireless_128bit_ascii_to_hex (const unsigned char *ascii);
|
char * nm_wireless_128bit_ascii_to_hex (const char *ascii);
|
||||||
char * nm_wireless_128bit_key_from_passphrase (const char *passphrase);
|
char * nm_wireless_128bit_key_from_passphrase (const char *passphrase);
|
||||||
|
|
||||||
int nm_wireless_qual_to_percent (const struct iw_quality *qual,
|
int nm_wireless_qual_to_percent (const struct iw_quality *qual,
|
||||||
|
Reference in New Issue
Block a user