diff options
| author | Michael Biebl <biebl@debian.org> | 2011-05-04 21:35:57 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2011-05-04 21:35:57 +0200 |
| commit | 3241555aff5c969104e492501097f4cb8837bcca (patch) | |
| tree | 6d15a02d02a9f1bfcda6075ae2b8c71537d8038d /libnm-util | |
| parent | e1b66c145e71e7bc6a06845dd17788fb7b8e158e (diff) | |
| parent | 9f806e97a24bba61417ae312fcc0da40914266fb (diff) | |
Merge commit 'upstream/0.8.999' into experimental
Diffstat (limited to 'libnm-util')
| -rw-r--r-- | libnm-util/Makefile.in | 7 | ||||
| -rw-r--r-- | libnm-util/crypto.c | 19 | ||||
| -rw-r--r-- | libnm-util/libnm-util.ver | 2 | ||||
| -rw-r--r-- | libnm-util/nm-connection.c | 6 | ||||
| -rw-r--r-- | libnm-util/nm-setting-wired.c | 6 | ||||
| -rw-r--r-- | libnm-util/nm-utils.c | 12 | ||||
| -rw-r--r-- | libnm-util/tests/Makefile.am | 3 | ||||
| -rw-r--r-- | libnm-util/tests/Makefile.in | 10 | ||||
| -rw-r--r-- | libnm-util/tests/certs/Makefile.am | 1 | ||||
| -rw-r--r-- | libnm-util/tests/certs/Makefile.in | 8 | ||||
| -rw-r--r-- | libnm-util/tests/certs/test_ca_cert.der | bin | 0 -> 1162 bytes |
11 files changed, 61 insertions, 13 deletions
diff --git a/libnm-util/Makefile.in b/libnm-util/Makefile.in index 5b092e82..d251ea8c 100644 --- a/libnm-util/Makefile.in +++ b/libnm-util/Makefile.in @@ -238,6 +238,10 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -355,6 +359,8 @@ POLKIT_CFLAGS = @POLKIT_CFLAGS@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +QT_CFLAGS = @QT_CFLAGS@ +QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ RESOLVCONF_PATH = @RESOLVCONF_PATH@ SED = @SED@ @@ -376,6 +382,7 @@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ diff --git a/libnm-util/crypto.c b/libnm-util/crypto.c index ffb3cbdd..991b3c3e 100644 --- a/libnm-util/crypto.c +++ b/libnm-util/crypto.c @@ -585,14 +585,19 @@ crypto_load_and_verify_certificate (const char *file, return contents; } - array = extract_pem_cert_data (contents, error); - if (!array) { - g_byte_array_free (contents, TRUE); - return NULL; - } + /* Check for plain DER format */ + if (contents->len > 2 && contents->data[0] == 0x30 && contents->data[1] == 0x82) { + *out_file_format = crypto_verify_cert (contents->data, contents->len, error); + } else { + array = extract_pem_cert_data (contents, error); + if (!array) { + g_byte_array_free (contents, TRUE); + return NULL; + } - *out_file_format = crypto_verify_cert (array->data, array->len, error); - g_byte_array_free (array, TRUE); + *out_file_format = crypto_verify_cert (array->data, array->len, error); + g_byte_array_free (array, TRUE); + } if (*out_file_format != NM_CRYPTO_FILE_FORMAT_X509) { g_byte_array_free (contents, TRUE); diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index a15b3d67..bb988bc4 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -415,6 +415,8 @@ global: nm_utils_ip4_routes_to_gvalue; nm_utils_ip6_addresses_from_gvalue; nm_utils_ip6_addresses_to_gvalue; + nm_utils_ip6_dns_from_gvalue; + nm_utils_ip6_dns_to_gvalue; nm_utils_ip6_routes_from_gvalue; nm_utils_ip6_routes_to_gvalue; nm_utils_is_empty_ssid; diff --git a/libnm-util/nm-connection.c b/libnm-util/nm-connection.c index f5dd1661..cd9d53ff 100644 --- a/libnm-util/nm-connection.c +++ b/libnm-util/nm-connection.c @@ -162,7 +162,7 @@ setting_register (const char *name, GType type) g_hash_table_insert (registered_settings, g_strdup (name), g_strdup (g_type_name (type))); } -#if UNUSED +#if 0 static void setting_unregister (const char *name) { @@ -897,7 +897,7 @@ nm_connection_need_secrets (NMConnection *connection, NMConnectionPrivate *priv; GSList *settings = NULL; GSList *iter; - char *name = NULL; + const char *name = NULL; g_return_val_if_fail (connection != NULL, NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); @@ -923,7 +923,7 @@ nm_connection_need_secrets (NMConnection *connection, else g_ptr_array_free (secrets, TRUE); - name = (char *) nm_setting_get_name (setting); + name = nm_setting_get_name (setting); break; } } diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c index ad47ac94..8691aeee 100644 --- a/libnm-util/nm-setting-wired.c +++ b/libnm-util/nm-setting-wired.c @@ -107,7 +107,7 @@ static const char *valid_s390_opts[] = { "route6", "fake_broadcast", "broadcast_mode", "canonical_macaddr", "checksumming", "sniffer", "large_send", "ipato_enable", "ipato_invert4", "ipato_add4", "ipato_invert6", "ipato_add6", "vipa_add4", "vipa_add6", - "rxip_add4", "rxip_add6", "lancmd_timeout", + "rxip_add4", "rxip_add6", "lancmd_timeout", "ctcprot", NULL }; @@ -197,7 +197,7 @@ nm_setting_wired_get_s390_subchannels (NMSettingWired *setting) * @setting: the #NMSettingWired * * Returns the s390 device type this connection should apply to. Will be one - * of 'qeth', 'lcs', or 'ctcm'. + * of 'qeth', 'lcs', or 'ctc'. * * Returns: the s390 device type **/ @@ -361,7 +361,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting); const char *valid_ports[] = { "tp", "aui", "bnc", "mii", NULL }; const char *valid_duplex[] = { "half", "full", NULL }; - const char *valid_nettype[] = { "qeth", "lcs", "ctcm", NULL }; + const char *valid_nettype[] = { "qeth", "lcs", "ctc", NULL }; GHashTableIter iter; const char *key, *value; diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index daa977cc..bac7fda3 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -1884,6 +1884,18 @@ nm_utils_ip6_dns_from_gvalue (const GValue *value) return g_slist_reverse (list); } +/** + * nm_utils_ip6_dns_to_gvalue: (skip): + * @list: a list of #NMIP6Route objects + * @value: a pointer to a #GValue into which to place the converted DNS server + * addresses, which should be unset by the caller (when no longer needed) with + * g_value_unset(). + * + * Utility function to convert a #GSList of 'struct in6_addr' structs into a + * GPtrArray of GByteArrays representing each server's IPv6 addresses in + * network byte order. The specific format of this serialization is not + * guaranteed to be stable and may be extended in the future. + */ void nm_utils_ip6_dns_to_gvalue (GSList *list, GValue *value) { diff --git a/libnm-util/tests/Makefile.am b/libnm-util/tests/Makefile.am index 4e2a8a78..daf4d688 100644 --- a/libnm-util/tests/Makefile.am +++ b/libnm-util/tests/Makefile.am @@ -93,6 +93,9 @@ check-local: test-settings-defaults test-crypto test-secrets # Another CA certificate $(abs_builddir)/test-crypto --cert $(srcdir)/certs/test2_ca_cert.pem +# Normal CA certificate (DER format) + $(abs_builddir)/test-crypto --cert $(srcdir)/certs/test_ca_cert.der + # CA certificate without an ending newline $(abs_builddir)/test-crypto --cert $(srcdir)/certs/ca-no-ending-newline.pem diff --git a/libnm-util/tests/Makefile.in b/libnm-util/tests/Makefile.in index 42c80c65..9e65094c 100644 --- a/libnm-util/tests/Makefile.in +++ b/libnm-util/tests/Makefile.in @@ -174,6 +174,10 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -291,6 +295,8 @@ POLKIT_CFLAGS = @POLKIT_CFLAGS@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +QT_CFLAGS = @QT_CFLAGS@ +QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ RESOLVCONF_PATH = @RESOLVCONF_PATH@ SED = @SED@ @@ -312,6 +318,7 @@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -943,6 +950,9 @@ uninstall-am: # Another CA certificate @WITH_TESTS_TRUE@ $(abs_builddir)/test-crypto --cert $(srcdir)/certs/test2_ca_cert.pem +# Normal CA certificate (DER format) +@WITH_TESTS_TRUE@ $(abs_builddir)/test-crypto --cert $(srcdir)/certs/test_ca_cert.der + # CA certificate without an ending newline @WITH_TESTS_TRUE@ $(abs_builddir)/test-crypto --cert $(srcdir)/certs/ca-no-ending-newline.pem diff --git a/libnm-util/tests/certs/Makefile.am b/libnm-util/tests/certs/Makefile.am index 4cd8a24b..02d5a5f5 100644 --- a/libnm-util/tests/certs/Makefile.am +++ b/libnm-util/tests/certs/Makefile.am @@ -9,6 +9,7 @@ EXTRA_DIST = \ test_ca_cert.pem \ + test_ca_cert.der \ test_key_and_cert.pem \ test-cert.p12 \ test2_ca_cert.pem \ diff --git a/libnm-util/tests/certs/Makefile.in b/libnm-util/tests/certs/Makefile.in index fe5156ce..873218e8 100644 --- a/libnm-util/tests/certs/Makefile.in +++ b/libnm-util/tests/certs/Makefile.in @@ -85,6 +85,10 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -202,6 +206,8 @@ POLKIT_CFLAGS = @POLKIT_CFLAGS@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +QT_CFLAGS = @QT_CFLAGS@ +QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ RESOLVCONF_PATH = @RESOLVCONF_PATH@ SED = @SED@ @@ -223,6 +229,7 @@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -272,6 +279,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ test_ca_cert.pem \ + test_ca_cert.der \ test_key_and_cert.pem \ test-cert.p12 \ test2_ca_cert.pem \ diff --git a/libnm-util/tests/certs/test_ca_cert.der b/libnm-util/tests/certs/test_ca_cert.der new file mode 100644 index 00000000..e844f65b --- /dev/null +++ b/libnm-util/tests/certs/test_ca_cert.der Binary files differ |