Commit Graph

69 Commits

Author SHA1 Message Date
Dan Williams
e68e27aa75 libnm-util: add 'flags' argument to nm_connection_to_hash() and nm_setting_to_hash()
Simplifies code internally, and makes it easier for clients as well in
some cases where they want to control what ends up in the resulting
hash and what does not.
2011-01-26 14:14:37 -06:00
Dan Williams
a1731c6064 libnm-util: fix max APN length
It's not 20, it's DNS domain name length.
2010-09-22 13:44:18 -05:00
Dan Williams
0ec9bf2c73 libnm-util: enforce APN character restrictions
APNs can only contain alphanumeric characters, '.', and '-'.  To be
helpful we strip spaces off before setting the APN internally so that
previously (and incorrectly) valid APNs don't cause the whole
connection to fail validation and thus disappear.  The only case seen
in the wild was a Pelephone IL APN which erroneously had a trailing
space in the mobile broadband provider database.  Bad characters
cause the connection to fail with vague error messages about being
unable to activate the PDP context during PPP negotiation.
2010-09-22 13:20:02 -05: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
2ef7ea02b3 test: enable IPv6 setting defaults test 2010-01-08 14:57:23 -08:00
Dan Williams
4274edf47d libnm-util: client certificate should not be required to set private key (bgo #585570)
Not sure what I was thinking originally; there's no way this was
correct in the first place.
2009-12-08 16:52:24 -08:00
Dan Williams
15497fd10f libnm-util: handle PEM files without an ending newline (rh #507315)
Due to an off-by-one bug if the ending PEM tag was the last thing
in the file, it would get missed.  Add some testcases for that too.
2009-11-18 16:29:48 -08:00
Dan Williams
df32cfbfd8 libnm-util: don't allow blank or NULL VPN items or secrets (rh #532084)
Weren't supposed to be allowed anyway; fix that and add a testcase for it.
2009-11-02 10:57:31 -08:00
Dan Williams
40c91efa21 libnm-util: fix checking for TLS and TTLS phase2 secrets
Two errors here; first, need_secrets_tls() was not updated correctly
for the certificate paths changes that landed recently, and would
have incorrectly returned "no secrets required" for the PATH scheme.

Second, an incorrect strcmp() comparison in need_secrets_phase2()
meant that the wrong TTLS phase2 method would get asked if it
required secrets.
2009-10-18 23:45:26 -07:00
Dan Williams
12aa505d3c libnm-util: fix distcheck after 7a8611e0ad 2009-10-02 17:20:38 -07:00
Dan Williams
7a8611e0ad libnm-util: fix NSS padding checking and add testcase 2009-10-02 13:29:43 -07: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 Williams
e5ed391f28 libnm-util: allow certificate/key paths
Overload the certificate and key properties to allow paths to the
certificates and keys using a special prefix for the property data.
Add API to libnm-util for easy certificate path handling, and
documentation for NMSetting8021x.
2009-09-04 09:07:00 -05:00
Dan Williams
537c2f1f86 build: always link locally-built libraries first (bgo #580131) 2009-08-20 12:31:17 -05:00
Dan Williams
b87c5495ea core: don't shadow basename (2) 2009-04-21 18:29:44 -04:00
Dan Williams
ba5a7024bd core: use _GNU_SOURCE consistently 2009-04-21 18:29:25 -04:00
Dan Williams
73659e724c makefile cleanups
0.7 requires dbus 1.1 or greater (for system bus activation), so make that
explicit, and remove compat code for D-Bus 0.6 and earlier.  Consolidate
the various glib pkgconfig checks into one, since most anything will require
gthread, glib, and gobject anyway.  Fixup the docs makefile to be more
automake-compatible and let 'make clean' actually work correctly when
docs are built.
2009-02-15 11:20:25 -05:00
Dan Williams
203cff4d83 libnm-util: move crypto tests to libnm-util/tests/
Add testing certs and keys; run crypto tests on 'make check'
2009-02-02 01:03:15 -05:00
Dan Williams
b61b199776 libnm-util: flag properties with G_PARAM_CONSTRUCT so default values get set
This caused the 'autoconnect' property of NMSettingConnection to not
get updated in some cases (as when a system setting plugin noticed a
change to autoconnect=true and emitted the Updated signal, which wouldn't
contain the new value).  Add a testcase for setting default values too.
2009-02-01 20:18:21 -05:00