Commit Graph

84 Commits

Author SHA1 Message Date
Jiří Klimeš
c0458cb433 docs: correct the description of nm_utils_ap_mode_security_valid() 2012-10-18 11:01:06 +02:00
Dan Williams
e6bdb8bc55 libnm-util: add methods for AP-mode security filtering
Add a helper like nm_utils_security_valid() except for access point
mode.  We can't use nm_utils_security_valid() without changing the
arguments, hence the new function.  Plus in AP mode all you care about
are the device capabilities, not AP flags since the device *is*
the AP.
2012-10-17 14:07:37 -05:00
Dan Winship
6878d20ac4 all: Don't use ctype.h macros
The ctype macros (eg, isalnum(), tolower()) are locale-dependent. Use
glib's ASCII-only versions instead.

Also, replace isascii() with g_ascii_isprint(), since isascii()
accepts control characters, which isn't what the code wanted in any of
the places where it was using it.
2012-09-26 12:14:37 -04:00
Dan Winship
74b6b9c768 libnm-util: move nm_utils_is_uuid() here
This is useful outside the daemon too, so move it into libnm-utils.
2012-09-26 12:14:37 -04:00
Dan Williams
81ff3b0f44 libnm-util: minor cleanups for nm_utils_iface_valid_name() 2012-08-29 17:55:03 -05:00
Thomas Graf
b46508b5c6 libnm-util: move dev_valid_name() to libnm-util and make it public
The bridging code needs it as well.
2012-08-29 17:46:54 -05:00
Dan Williams
f19c33b56f docs: clarify byte order of returned value from nm_utils_ip4_prefix_to_netmask() 2012-08-13 11:00:54 -05:00
Jiří Klimeš
00297f49fb libnm-util: add nm_utils_file_is_pkcs12() for checking PKCS#12 file format 2012-07-16 14:59:59 +02:00
Colin Walters
c9aa5f76cf Fix various bits of broken gtk-doc
There was some duplication, syntax errors, etc.
2012-06-14 13:56:48 -04:00
Dan Williams
69247a00ea wifi: disable Ad-Hoc WPA connections (lp:905748)
The kernel is broken for Ad-Hoc WPA, and creates the connections
as open connections instead.  Yeah, eventually we can use
wpa_supplicant with RSN support, but for now we just have to
disable Ad-Hoc WPA because it's a problem to say we're creating
a protected network but then have the kernel not do that for
us.  Will be re-enabled once all the necessary bits have been
fixed.

Note that Ad-Hoc WPA has been broken since at least 2.6.32 with
mac80211-based drivers, which is what most users will be using.
2012-03-16 17:58:23 -05:00
Jiří Klimeš
bb6da998b2 libnm-util: do not assert on buggy drivers with no WEP cipher capabilities
The crash happens with ipw2200, kernel 3.2.0 when a user tries to connect
to a hidden network using nm-applet.
g_assert (have_ap); is hit in 'case NMU_SEC_STATIC_WEP:' branch.

Reported by Mathieu Trudel-Lapierre.
See also:
(lp:908516)
(lp:908380)
2012-03-13 15:37:11 +01:00
Dan Williams
ca27121ad6 libnm-util: register more GValue transformations for debugging 2012-02-07 12:33:03 -06:00
Dan Williams
a080a1ed08 libnm-util: fix some introspection annotations 2011-12-22 11:04:56 -06:00
Dan Williams
1f8090fb58 libnm-util: add nm_utils_hwaddr_type()
Returns the address type given the length.
2011-12-02 13:09:16 -06:00
Dan Williams
6e4eb4902e libnm-util: fix nm_utils_hwaddr_aton() for input with no leading zeros
ether_aton() allows addresses like "0:1:2:3:4:5" which was casusing
some problems when reading connections after switching callers of
ether_aton() to nm_utils_hwaddr_aton().
2011-12-02 13:09:16 -06:00
Dan Winship
2510c617ec libnm-util: add ether_ntoa/ether_aton-like utility methods
nm_utils_hwaddr_ntoa() and nm_utils_hwaddr_aton() are like
ether_ntoa()/ether_aton(), but handle IPoIB too.

nm_utils_hwaddr_atoba() is like _aton() but returns a GByteArray,
since that's what's wanted in many places.

Also remove nm_ether_ntop() and replace uses of it with
nm_utils_hwaddr_ntoa().
2011-11-17 13:37:08 -06:00
Dan Williams
a5c2c47b3e wifi: make wireless-helper.h private to src/
The less stuff that needs WEXT the better.
2011-11-09 21:28:02 -06:00
Dan Winship
7b7d7bce2f libnm-util: add some more introspection annotations to silence warnings 2011-10-14 10:09:46 -05:00
Dan Williams
2a5617c22b docs: update documentation for nm_utils_security_valid() 2011-08-22 20:33:07 -05:00
Dan Williams
07c9de48df libnm-util: fix symbol export checks to catch un-exported ones too
The current check caught stuff in the .ver file that was outdated, but
didn't quite get stuff that was supposed to be exported but wasn't,
in some cases.  Update the regex to ensure that symbols that are
not exported, but that start with "nm_" (and aren't GObject
boilerplate) get flagged during the check.

Update internal code to return to a previous pattern of treating symbols
that start with "_" internal, and expecting symbols that start with
"nm_" to be exported.

Also fixes cases where random glibc symbols would get flagged:

00040ff4 l     O *ABS*  00000000              .hidden _GLOBAL_OFFSET_TABLE_
00041380 l     O .data  00000000              .hidden __dso_handle
000406e8 l     O .dtors 00000000              .hidden __DTOR_END__
0000fbe4 l     F .text  00000000              .hidden __i686.get_pc_thunk.cx
0002f980 l     F .text  00000014              .hidden __stack_chk_fail_local
0000b1e7 l     F .text  00000000              .hidden __i686.get_pc_thunk.bx
00040e60 l     O *ABS*  00000000              .hidden _DYNAMIC
2011-05-05 12:26:17 -05:00
Dan Williams
a2fc80b0ea libnm-util: document nm_utils_ip6_dns_to_gvalue() 2011-05-02 22:54:28 -05:00
Dan Williams
5b0ef4c201 libnm-util: don't ever deinit crypto methods (bgo #646300)
Because we can't ever know if we're the last user of NSS or gnutls
when nm_utils_deinit() is called, just don't bother deiniting
the crypto providers.  And atexit handlers are generally frowned
upon for the exact same reason.  You never know what library linked
into your process might be also using NSS or gnutls, so basically
if these libraries suck enough to use global data and not reference
count it, just let the data leak.  If we do clean stuff up that
can lead to crashes when other libraries might try to use NSS or
gnutls after the atexit handler or nm_utils_deinit() has been run.

See also:  https://bugzilla.mozilla.org/show_bug.cgi?id=54189#c1
2011-03-31 13:29:19 -05:00
Kjartan Maraas
6d0d302916 build: do the right thing with config.h (bgo #644664)
1) it shouldn't be included in headers
2) it should be the first thing included in source files
3) it's needed for getting translation right
2011-03-14 01:01:22 -05:00
Dan Williams
eab5851145 libnm-util: remove nm_warning/nm_info/nm_error macros
Clients need to do their own logging using glib or whatever; these
macros while somewhat helpful were not flexible and are not a
substitute for actual logging in the client.  g_warning, g_message,
and g_error are more suitable anyway.
2011-02-23 11:42:04 -06:00
Dan Williams
b599e3e5dc libnm-util: simplify nm_utils_ssid_to_utf8()
It's always used with a GByteArray anyway, as are most
functions in nm-utils.h.  Even better, we can skip the
memcpy since it turns out to be pointless.
2011-02-23 11:24:58 -06:00
Giovanni Campagna
3ebecd2a29 introspection: add GObject introspection support (bgo #637032)
Add the necessary annotations (the mininum required, that is those
on return values. NULL parameters or container types may require
more), and the Autotools stuff to get a NetworkManager GIR for
libnm-util and a NMClient for libnm-glib.
2011-01-21 14:46:09 -06:00
Jiří Klimeš
b3800183b4 libnm-util: fix nm_utils_security_valid() checks for Ad-Hoc APs (rh #632123)
Without the fix fake Ad-Hoc APs created by nm-applet's "Create New Wireless
Network..." don't pass the check and nm-applet can crash.
2010-12-16 14:03:04 +01:00
Dan Williams
f257c98193 libnm-util: register transform func for G_TYPE_STRV to GPtrArray
Needed for S390 subchannels property of the wired setting.
2010-07-28 10:05:22 -07:00
Dan Williams
a5d8872c3e Merge remote branch 'origin/master' into zvm 2010-06-17 21:14:09 -07:00
Jiří Klimeš
12d26643e9 libnm-util: add nm_utils_wifi_* functions to handle frequencies/channels 2010-05-31 15:32:13 +02:00
Dan Williams
04370354f0 libnm-util: pretty-print DBUS_TYPE_G_ARRAY_OF_STRING 2010-05-26 17:04:32 -07:00
Dan Williams
7ffcb98afd doc: trivial fix 2010-05-26 01:20:20 -07:00
Dan Williams
cc0c2783b6 libnm-util: fix IPv6 address array -> string transform
Only used for debugging, but it's nice to see the actual address
instead of a transform error.
2010-04-30 15:29:53 -07:00
Dan Williams
151a2b4c5a libnm-util: quiet harmless message in type conversion 2010-04-19 15:10:03 -07:00
Dan Williams
83652e6b8e libnm-util: convert from old IP6 address format to new
Ensure it still works correctly if something tries to set the
'addresses' property using the old GType.  Also make sure that
the various IP6 address comparison operations and string conversion
functions handle the gateway.
2010-04-19 10:14:44 -07:00
Dan Williams
44ea07a5d7 libnm-util: add gateway member to IPv6 addresses 2010-04-17 10:26:53 -07:00
Jiří Klimeš
5225949974 libnm-util: fix dump of routes in 'ipv4' setting 2010-03-29 15:10:25 +02:00
Jiří Klimeš
eedde7283f libnm-util: add functions to output ip6 settings of connections 2010-03-22 18:59:40 +01:00
Jirka Klimes
0f0daf7852 core: determine classful IPv4 prefix if no DHCP netmask is provided (bgo #603098) 2010-02-25 16:52:10 -08:00
Dan Williams
c0d7c2579e libnm-util: fix potential crash when encrypting fails 2009-12-23 11:08:26 -08:00
Dan Williams
8c35e96b60 libnm-util: add nm_utils_rsa_key_encrypt() and fix crypto padding mixups
To be backwards compatible clients need to handle both paths to private
keys and the decrypted private key data, which is what used to get passed
in the private-key and phase2-private-key attributes of the 802.1x setting.
When moving a connection around between system-settings and user-settings,
if the private key is decrypted data, the settings service needs to store
that decrypted data somewhere so that the key can be sent to NM during
the connection process.

But we don't want to store the decrypted private key data, so we have to
re-encrypt it (possibly generating a private key password if one wasn't
sent with the decrypted data) and save it to disk, then send NM a path
to that private key during connection.

To help clients do this, and so that they don't have to carry around
multiple crypto implementations depending on whether they want to use
NSS or gnutls/gcrypt, add a helper to libnm-util.

Furthermore, I misunderstood a bunch of stuff with crypto padding when
writing the encrypt/decrypt functions long ago, so fix that up.  Don't
return padding as part of the decrypted data, and make sure to verify
the padding's expected lengths and values when decrypting.  Many thanks
to Nalin Dahyabhai for pointing me in the right direction.
2009-09-15 16:01:50 -07:00
Dan Winship
90bd1ad5cd Install and fix up libnm-util IPv6 config stuff 2009-07-29 21:34:19 -04:00
Dan Williams
2c4919ae84 libnm-util: allocate correct size for uuid 2009-04-14 09:09:48 -04:00
Dan Williams
f3f1ee18d4 libnm-util: fix array transforms when arrays are NULL 2009-04-14 09:09:07 -04:00
Dan Williams
fa72dc27e0 libnm-util: add transform for byte arrays; fix IP4 address transform for prefix 2009-04-14 09:08:33 -04:00
Dan Williams
d5bbd6dd49 libnm-util: fix WPA Ad-Hoc capability matching
Drivers won't necessarily add the "PSK" flag to the beacon for Ad-Hoc
APs, which is fine because PSK is the only type of security that Ad-Hoc
can do.
2009-03-04 17:18:24 -05:00
Dan Williams
a734c836a5 libnm-util: ignore Privacy for APs broadcasting WPA & RSN IEs (rh #445369)
While broadcasting WPA and RSN IEs with the Privacy bit set to 0 is
technically illegal, some networks using older Cisco equipment do it
(I'm looking at you, Eduroam) and there's no reason not to support
it.  Since the AP is broadcasting WPA/RSN IEs, assume that means
WPA and RSN is supported (duh).
2009-02-06 17:32:56 -05:00
Dan Williams
ad4d2baec9 Documentation updates
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4333 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-24 16:55:37 +00:00
Dan Williams
2328650d2e Documentation fixes
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4328 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-23 22:55:03 +00:00
Dan Williams
1f5394567d 2008-11-20 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-utils.c
	  libnm-util/nm-utils.h
		- More documentation updates



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4321 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-20 21:07:03 +00:00