diff options
Diffstat (limited to 'libnm-util/nm-setting-8021x.c')
| -rw-r--r-- | libnm-util/nm-setting-8021x.c | 540 |
1 files changed, 171 insertions, 369 deletions
diff --git a/libnm-util/nm-setting-8021x.c b/libnm-util/nm-setting-8021x.c index d85b87b8..6d5268a1 100644 --- a/libnm-util/nm-setting-8021x.c +++ b/libnm-util/nm-setting-8021x.c @@ -1,9 +1,6 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * Dan Williams <dcbw@redhat.com> - * Tambet Ingo <tambet@gmail.com> - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -19,13 +16,15 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2013 Red Hat, Inc. - * (C) Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2013 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. */ +#include "config.h" + #include <string.h> #include <dbus/dbus-glib.h> -#include <glib/gi18n.h> +#include <glib/gi18n-lib.h> #include "nm-setting-8021x.h" #include "nm-param-spec-specialized.h" @@ -92,6 +91,11 @@ NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_802_1X) #define NM_SETTING_802_1X_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_802_1X, NMSetting8021xPrivate)) +G_STATIC_ASSERT ( (NM_SETTING_802_1X_CK_FORMAT_UNKNOWN == (NMSetting8021xCKFormat) NM_CRYPTO_FILE_FORMAT_UNKNOWN) ); +G_STATIC_ASSERT ( (NM_SETTING_802_1X_CK_FORMAT_X509 == (NMSetting8021xCKFormat) NM_CRYPTO_FILE_FORMAT_X509) ); +G_STATIC_ASSERT ( (NM_SETTING_802_1X_CK_FORMAT_RAW_KEY == (NMSetting8021xCKFormat) NM_CRYPTO_FILE_FORMAT_RAW_KEY) ); +G_STATIC_ASSERT ( (NM_SETTING_802_1X_CK_FORMAT_PKCS12 == (NMSetting8021xCKFormat) NM_CRYPTO_FILE_FORMAT_PKCS12) ); + typedef struct { GSList *eap; /* GSList of strings */ char *identity; @@ -408,7 +412,7 @@ nm_setting_802_1x_get_ca_path (NMSetting8021x *setting) * properties are ignored if the #NMSetting8021x:system-ca-certs property is * %TRUE, in which case a system-wide CA certificate directory specified at * compile time (using the --system-ca-path configure option) is used in place - * of these properties. + * of these properties. * * Returns: %TRUE if a system CA certificate path should be used, %FALSE if not **/ @@ -836,7 +840,7 @@ nm_setting_802_1x_get_client_cert_path (NMSetting8021x *setting) * @setting: the #NMSetting8021x * @cert_path: when @scheme is set to either %NM_SETTING_802_1X_CK_SCHEME_PATH * or %NM_SETTING_802_1X_CK_SCHEME_BLOB, pass the path of the client - * certificate file (PEM, DER, or PKCS#12 format). The path must be UTF-8 + * certificate file (PEM, DER, or PKCS#<!-- -->12 format). The path must be UTF-8 * encoded; use g_filename_to_utf8() to convert if needed. Passing %NULL with * any @scheme clears the client certificate. * @scheme: desired storage scheme for the certificate @@ -1421,7 +1425,7 @@ nm_setting_802_1x_get_phase2_client_cert_path (NMSetting8021x *setting) * @setting: the #NMSetting8021x * @cert_path: when @scheme is set to either %NM_SETTING_802_1X_CK_SCHEME_PATH * or %NM_SETTING_802_1X_CK_SCHEME_BLOB, pass the path of the "phase2" client - * certificate file (PEM, DER, or PKCS#12 format). The path must be UTF-8 + * certificate file (PEM, DER, or PKCS#<!-- -->12 format). The path must be UTF-8 * encoded; use g_filename_to_utf8() to convert if needed. Passing %NULL with * any @scheme clears the "phase2" client certificate. * @scheme: desired storage scheme for the certificate @@ -1696,7 +1700,7 @@ file_to_byte_array (const char *filename) * @setting: the #NMSetting8021x * @key_path: when @scheme is set to either %NM_SETTING_802_1X_CK_SCHEME_PATH or * %NM_SETTING_802_1X_CK_SCHEME_BLOB, pass the path of the private key file - * (PEM, DER, or PKCS#12 format). The path must be UTF-8 encoded; use + * (PEM, DER, or PKCS#<!-- -->12 format). The path must be UTF-8 encoded; use * g_filename_to_utf8() to convert if needed. Passing %NULL with any @scheme * clears the private key. * @password: password used to decrypt the private key, or %NULL if the password @@ -1824,7 +1828,7 @@ nm_setting_802_1x_set_private_key (NMSetting8021x *setting, g_object_notify (G_OBJECT (setting), NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD); if (out_format) - *out_format = format; + *out_format = (NMSetting8021xCKFormat) format; return priv->private_key != NULL; } @@ -2007,7 +2011,7 @@ nm_setting_802_1x_get_phase2_private_key_path (NMSetting8021x *setting) * @setting: the #NMSetting8021x * @key_path: when @scheme is set to either %NM_SETTING_802_1X_CK_SCHEME_PATH or * %NM_SETTING_802_1X_CK_SCHEME_BLOB, pass the path of the "phase2" private - * key file (PEM, DER, or PKCS#12 format). The path must be UTF-8 encoded; + * key file (PEM, DER, or PKCS#<!-- -->12 format). The path must be UTF-8 encoded; * use g_filename_to_utf8() to convert if needed. Passing %NULL with any * @scheme clears the private key. * @password: password used to decrypt the private key, or %NULL if the password @@ -2135,7 +2139,7 @@ nm_setting_802_1x_set_phase2_private_key (NMSetting8021x *setting, g_object_notify (G_OBJECT (setting), NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD); if (out_format) - *out_format = format; + *out_format = (NMSetting8021xCKFormat) format; return priv->phase2_private_key != NULL; } @@ -2819,7 +2823,7 @@ set_cert_prop_helper (const GValue *value, const char *prop_name, GError **error static void set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec) + const GValue *value, GParamSpec *pspec) { NMSetting8021x *setting = NM_SETTING_802_1X (object); NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (setting); @@ -3005,7 +3009,7 @@ set_property (GObject *object, guint prop_id, static void get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) + GValue *value, GParamSpec *pspec) { NMSetting8021x *setting = NM_SETTING_802_1X (object); NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (setting); @@ -3143,17 +3147,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_EAP, - _nm_param_spec_specialized (NM_SETTING_802_1X_EAP, - "EAP", - "The allowed EAP method to be used when " - "authenticating to the network with 802.1x. " - "Valid methods are: 'leap', 'md5', 'tls', 'peap', " - "'ttls', 'pwd', and 'fast'. Each method requires " - "different configuration using the properties of " - "this setting; refer to wpa_supplicant " - "documentation for the allowed combinations.", - DBUS_TYPE_G_LIST_OF_STRING, - G_PARAM_READWRITE)); + _nm_param_spec_specialized (NM_SETTING_802_1X_EAP, "", "", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:identity: @@ -3163,12 +3160,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_IDENTITY, - g_param_spec_string (NM_SETTING_802_1X_IDENTITY, - "Identity", - "Identity string for EAP authentication methods. " - "Often the user's user or login name.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_802_1X_IDENTITY, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:anonymous-identity: @@ -3179,14 +3174,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_ANONYMOUS_IDENTITY, - g_param_spec_string (NM_SETTING_802_1X_ANONYMOUS_IDENTITY, - "Anonymous identity", - "Anonymous identity string for EAP authentication " - "methods. Used as the unencrypted identity with EAP " - "types that support different tunneled identity like " - "EAP-TTLS.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_802_1X_ANONYMOUS_IDENTITY, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:pac-file: @@ -3195,11 +3186,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PAC_FILE, - g_param_spec_string (NM_SETTING_802_1X_PAC_FILE, - "PAC file", - "UTF-8 encoded file path containing PAC for EAP-FAST.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_802_1X_PAC_FILE, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:ca-cert: @@ -3221,24 +3211,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_CA_CERT, - _nm_param_spec_specialized (NM_SETTING_802_1X_CA_CERT, - "CA certificate", - "Contains the CA certificate if used by the EAP " - "method specified in the 'eap' property. " - "Certificate data is specified using a 'scheme'; " - "two are currently supported: blob and path. " - "When using the blob scheme (which is backwards " - "compatible with NM 0.7.x) this property should " - "be set to the certificate's DER encoded data. " - "When using the path scheme, this property should " - "be set to the full UTF-8 encoded path of the " - "certificate, prefixed with the string 'file://' " - "and ending with a terminating NULL byte. This " - "property can be unset even if the EAP method " - "supports CA certificates, but this allows " - "man-in-the-middle attacks and is NOT recommended.", - DBUS_TYPE_G_UCHAR_ARRAY, - G_PARAM_READWRITE)); + _nm_param_spec_specialized (NM_SETTING_802_1X_CA_CERT, "", "", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:ca-path: @@ -3249,14 +3225,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_CA_PATH, - g_param_spec_string (NM_SETTING_802_1X_CA_PATH, - "CA path", - "UTF-8 encoded path to a directory containing PEM or " - "DER formatted certificates to be added to the " - "verification chain in addition to the certificate " - "specified in the 'ca-cert' property.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_802_1X_CA_PATH, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:subject-match: @@ -3267,15 +3239,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_SUBJECT_MATCH, - g_param_spec_string (NM_SETTING_802_1X_SUBJECT_MATCH, - "Subject match", - "Substring to be matched against the subject of " - "the certificate presented by the authentication " - "server. When unset, no verification of the " - "authentication server certificate's subject is " - "performed.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_802_1X_SUBJECT_MATCH, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:altsubject-matches: @@ -3284,18 +3251,12 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) * certificate presented by the authentication server. If the list is empty, * no verification of the server certificate's altSubjectName is performed. **/ - g_object_class_install_property - (object_class, PROP_ALTSUBJECT_MATCHES, - _nm_param_spec_specialized (NM_SETTING_802_1X_ALTSUBJECT_MATCHES, - "altSubjectName matches", - "List of strings to be matched against " - "the altSubjectName of the certificate " - "presented by the authentication server. " - "If the list is empty, no verification " - "of the server certificate's " - "altSubjectName is performed.", - DBUS_TYPE_G_LIST_OF_STRING, - G_PARAM_READWRITE)); + g_object_class_install_property + (object_class, PROP_ALTSUBJECT_MATCHES, + _nm_param_spec_specialized (NM_SETTING_802_1X_ALTSUBJECT_MATCHES, "", "", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:client-cert: @@ -3315,21 +3276,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_CLIENT_CERT, - _nm_param_spec_specialized (NM_SETTING_802_1X_CLIENT_CERT, - "Client certificate", - "Contains the client certificate if used by the " - "EAP method specified in the 'eap' property. " - "Certificate data is specified using a 'scheme'; " - "two are currently supported: blob and path. " - "When using the blob scheme (which is backwards " - "compatible with NM 0.7.x) this property should " - "be set to the certificate's DER encoded data. " - "When using the path scheme, this property should " - "be set to the full UTF-8 encoded path of the " - "certificate, prefixed with the string 'file://' " - "and ending with a terminating NULL byte.", - DBUS_TYPE_G_UCHAR_ARRAY, - G_PARAM_READWRITE)); + _nm_param_spec_specialized (NM_SETTING_802_1X_CLIENT_CERT, "", "", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase1-peapver: @@ -3343,17 +3293,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PHASE1_PEAPVER, - g_param_spec_string (NM_SETTING_802_1X_PHASE1_PEAPVER, - "Phase1 PEAPVER", - "Forces which PEAP version is used when PEAP is set " - "as the EAP method in 'eap' property. When unset, " - "the version reported by the server will be used. " - "Sometimes when using older RADIUS servers, it is " - "necessary to force the client to use a particular " - "PEAP version. To do so, this property may be set to " - "'0' or '1' to force that specific PEAP version.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_802_1X_PHASE1_PEAPVER, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase1-peaplabel: @@ -3365,15 +3308,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PHASE1_PEAPLABEL, - g_param_spec_string (NM_SETTING_802_1X_PHASE1_PEAPLABEL, - "Phase1 PEAP label", - "Forces use of the new PEAP label during key " - "derivation. Some RADIUS servers may require forcing " - "the new PEAP label to interoperate with PEAPv1. " - "Set to '1' to force use of the new PEAP label. See " - "the wpa_supplicant documentation for more details.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_802_1X_PHASE1_PEAPLABEL, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase1-fast-provisioning: @@ -3387,18 +3325,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PHASE1_FAST_PROVISIONING, - g_param_spec_string (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING, - "Phase1 fast provisioning", - "Enables or disables in-line provisioning of EAP-FAST " - "credentials when FAST is specified as the EAP method " - "in the #NMSetting8021x:eap property. Allowed values " - "are '0' (disabled), '1' (allow unauthenticated " - "provisioning), '2' (allow authenticated provisioning), " - "and '3' (allow both authenticated and unauthenticated " - "provisioning). See the wpa_supplicant documentation " - "for more details.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase2-auth: @@ -3412,18 +3342,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PHASE2_AUTH, - g_param_spec_string (NM_SETTING_802_1X_PHASE2_AUTH, - "Phase2 auth", - "Specifies the allowed 'phase 2' inner non-EAP " - "authentication methods when an EAP method that uses " - "an inner TLS tunnel is specified in the 'eap' " - "property. Recognized non-EAP phase2 methods are 'pap', " - "'chap', 'mschap', 'mschapv2', 'gtc', 'otp', 'md5', " - "and 'tls'. Each 'phase 2' inner method requires " - "specific parameters for successful authentication; " - "see the wpa_supplicant documentation for more details.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_802_1X_PHASE2_AUTH, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase2-autheap: @@ -3437,18 +3359,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PHASE2_AUTHEAP, - g_param_spec_string (NM_SETTING_802_1X_PHASE2_AUTHEAP, - "Phase2 autheap", - "Specifies the allowed 'phase 2' inner EAP-based " - "authentication methods when an EAP method that uses " - "an inner TLS tunnel is specified in the 'eap' " - "property. Recognized EAP-based 'phase 2' methods are " - "'md5', 'mschapv2', 'otp', 'gtc', and 'tls'. Each " - "'phase 2' inner method requires specific parameters " - "for successful authentication; see the wpa_supplicant " - "documentation for more details.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_802_1X_PHASE2_AUTHEAP, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase2-ca-cert: @@ -3471,25 +3385,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PHASE2_CA_CERT, - _nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_CA_CERT, - "Phase2 CA certificate", - "Contains the 'phase 2' CA certificate if used by " - "the EAP method specified in the 'phase2-auth' or " - "'phase2-autheap' properties. Certificate data " - "is specified using a 'scheme'; two are currently" - "supported: blob and path. When using the blob " - "scheme (which is backwards compatible with NM " - "0.7.x) this property should be set to the " - "certificate's DER encoded data. When using the " - "path scheme, this property should be set to the " - "full UTF-8 encoded path of the certificate, " - "prefixed with the string 'file://' and ending " - "with a terminating NULL byte. This property can " - "be unset even if the EAP method supports CA " - "certificates, but this allows man-in-the-middle " - "attacks and is NOT recommended.", - DBUS_TYPE_G_UCHAR_ARRAY, - G_PARAM_READWRITE)); + _nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_CA_CERT, "", "", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase2-ca-path: @@ -3500,14 +3399,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PHASE2_CA_PATH, - g_param_spec_string (NM_SETTING_802_1X_PHASE2_CA_PATH, - "Phase2 auth CA path", - "UTF-8 encoded path to a directory containing PEM or " - "DER formatted certificates to be added to the " - "verification chain in addition to the certificate " - "specified in the 'phase2-ca-cert' property.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_802_1X_PHASE2_CA_PATH, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase2-subject-match: @@ -3519,16 +3414,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PHASE2_SUBJECT_MATCH, - g_param_spec_string (NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH, - "Phase2 subject match", - "Substring to be matched against the subject of " - "the certificate presented by the authentication " - "server during the inner 'phase2' " - "authentication. When unset, no verification of " - "the authentication server certificate's subject " - "is performed.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase2-altsubject-matches: @@ -3538,20 +3427,12 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) * "phase 2" authentication. If the list is empty, no verification of the * server certificate's altSubjectName is performed. **/ - g_object_class_install_property - (object_class, PROP_PHASE2_ALTSUBJECT_MATCHES, - _nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES, - "altSubjectName matches", - "List of strings to be matched against " - "List of strings to be matched against " - "the altSubjectName of the certificate " - "presented by the authentication server " - "during the inner 'phase 2' " - "authentication. If the list is empty, no " - "verification of the server certificate's " - "altSubjectName is performed.", - DBUS_TYPE_G_LIST_OF_STRING, - G_PARAM_READWRITE)); + g_object_class_install_property + (object_class, PROP_PHASE2_ALTSUBJECT_MATCHES, + _nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES, "", "", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase2-client-cert: @@ -3574,22 +3455,10 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PHASE2_CLIENT_CERT, - _nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_CLIENT_CERT, - "Phase2 client certificate", - "Contains the 'phase 2' client certificate if " - "used by the EAP method specified in the " - "'phase2-auth' or 'phase2-autheap' properties. " - "Certificate data is specified using a 'scheme'; " - "two are currently supported: blob and path. " - "When using the blob scheme (which is backwards " - "compatible with NM 0.7.x) this property should " - "be set to the certificate's DER encoded data. " - "When using the path scheme, this property should " - "be set to the full UTF-8 encoded path of the " - "certificate, prefixed with the string 'file://' " - "and ending with a terminating NULL byte.", - DBUS_TYPE_G_UCHAR_ARRAY, - G_PARAM_READWRITE)); + _nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_CLIENT_CERT, "", "", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:password: @@ -3600,25 +3469,25 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PASSWORD, - g_param_spec_string (NM_SETTING_802_1X_PASSWORD, - "Password", - "UTF-8 encoded password used for EAP authentication methods.", - NULL, - G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET)); + g_param_spec_string (NM_SETTING_802_1X_PASSWORD, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_SECRET | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:password-flags: * * Flags indicating how to handle the #NMSetting8021x:password property. **/ - g_object_class_install_property (object_class, PROP_PASSWORD_FLAGS, - g_param_spec_uint (NM_SETTING_802_1X_PASSWORD_FLAGS, - "Password Flags", - "Flags indicating how to handle the 802.1x password.", + g_object_class_install_property + (object_class, PROP_PASSWORD_FLAGS, + g_param_spec_uint (NM_SETTING_802_1X_PASSWORD_FLAGS, "", "", NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_SECRET_FLAGS_ALL, NM_SETTING_SECRET_FLAG_NONE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:password-raw: @@ -3630,30 +3499,25 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PASSWORD_RAW, - _nm_param_spec_specialized (NM_SETTING_802_1X_PASSWORD_RAW, - "Password byte array", - "Password used for EAP authentication " - "methods, given as a byte array to allow " - "passwords in other encodings than UTF-8 " - "to be used. If both 'password' and " - "'password-raw' are given, 'password' is " - "preferred.", + _nm_param_spec_specialized (NM_SETTING_802_1X_PASSWORD_RAW, "", "", DBUS_TYPE_G_UCHAR_ARRAY, - G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET)); + G_PARAM_READWRITE | + NM_SETTING_PARAM_SECRET | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:password-raw-flags: * * Flags indicating how to handle the #NMSetting8021x:password-raw property. **/ - g_object_class_install_property (object_class, PROP_PASSWORD_RAW_FLAGS, - g_param_spec_uint (NM_SETTING_802_1X_PASSWORD_RAW_FLAGS, - "Password byte array Flags", - "Flags indicating how to handle the 802.1x password byte array.", + g_object_class_install_property + (object_class, PROP_PASSWORD_RAW_FLAGS, + g_param_spec_uint (NM_SETTING_802_1X_PASSWORD_RAW_FLAGS, "", "", NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_SECRET_FLAGS_ALL, NM_SETTING_SECRET_FLAG_NONE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:private-key: @@ -3666,15 +3530,15 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) * should be set to the key's encrypted PEM encoded data. When using private * keys with the path scheme, this property should be set to the full UTF-8 * encoded path of the key, prefixed with the string "file://" and ending - * with a terminating NUL byte. When using PKCS#12 format private keys and - * the blob scheme, this property should be set to the PKCS#12 data and the + * with a terminating NUL byte. When using PKCS#<!-- -->12 format private keys and + * the blob scheme, this property should be set to the PKCS#<!-- -->12 data and the * #NMSetting8021x:private-key-password property must be set to password - * used to decrypt the PKCS#12 certificate and key. When using PKCS#12 files + * used to decrypt the PKCS#<!-- -->12 certificate and key. When using PKCS#<!-- -->12 files * and the path scheme, this property should be set to the full UTF-8 * encoded path of the key, prefixed with the string "file://" and and * ending with a terminating NUL byte, and as with the blob scheme the * "private-key-password" property must be set to the password used to - * decode the PKCS#12 private key and certificate. + * decode the PKCS#<!-- -->12 private key and certificate. * * Setting this property directly is discouraged; use the * nm_setting_802_1x_set_private_key() function instead. @@ -3687,54 +3551,28 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PRIVATE_KEY, - _nm_param_spec_specialized (NM_SETTING_802_1X_PRIVATE_KEY, - "Private key", - "Contains the private key when the 'eap' property " - "is set to 'tls'. Key data is specified using a " - "'scheme'; two are currently supported: blob and " - "path. When using the blob scheme and private " - "keys, this property should be set to the key's " - "encrypted PEM encoded data. When using private " - "keys with the path scheme, this property should " - "be set to the full UTF-8 encoded path of the key, " - "prefixed with the string 'file://' and ending " - "with a terminating NULL byte. When using " - "PKCS#12 format private keys and the blob " - "scheme, this property should be set to the " - "PKCS#12 data and the 'private-key-password' " - "property must be set to password used to " - "decrypt the PKCS#12 certificate and key. When " - "using PKCS#12 files and the path scheme, this " - "property should be set to the full UTF-8 encoded " - "path of the key, prefixed with the string " - "'file://' and and ending with a terminating NULL " - "byte, and as with the blob scheme the " - "'private-key-password' property must be set to " - "the password used to decode the PKCS#12 private " - "key and certificate.", - DBUS_TYPE_G_UCHAR_ARRAY, - G_PARAM_READWRITE)); + _nm_param_spec_specialized (NM_SETTING_802_1X_PRIVATE_KEY, "", "", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:private-key-password: * * The password used to decrypt the private key specified in the * #NMSetting8021x:private-key property when the private key either uses the - * path scheme, or if the private key is a PKCS#12 format key. Setting this + * path scheme, or if the private key is a PKCS#<!-- -->12 format key. Setting this * property directly is not generally necessary except when returning * secrets to NetworkManager; it is generally set automatically when setting * the private key by the nm_setting_802_1x_set_private_key() function. **/ g_object_class_install_property (object_class, PROP_PRIVATE_KEY_PASSWORD, - g_param_spec_string (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, - "Private key password", - "The password used to decrypt the private key " - "specified in the 'private-key' property when the " - "private key either uses the path scheme, or if the " - "private key is a PKCS#12 format key.", - NULL, - G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET)); + g_param_spec_string (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_SECRET | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:private-key-password-flags: @@ -3742,15 +3580,14 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) * Flags indicating how to handle the #NMSetting8021x:private-key-password * property. **/ - g_object_class_install_property (object_class, PROP_PRIVATE_KEY_PASSWORD_FLAGS, - g_param_spec_uint (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD_FLAGS, - "Private Key Password Flags", - "Flags indicating how to handle the 802.1x private " - "key password.", + g_object_class_install_property + (object_class, PROP_PRIVATE_KEY_PASSWORD_FLAGS, + g_param_spec_uint (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD_FLAGS, "", "", NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_SECRET_FLAGS_ALL, NM_SETTING_SECRET_FLAG_NONE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase2-private-key: @@ -3764,70 +3601,43 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) * should be set to the key's encrypted PEM encoded data. When using private * keys with the path scheme, this property should be set to the full UTF-8 * encoded path of the key, prefixed with the string "file://" and ending - * with a terminating NUL byte. When using PKCS#12 format private keys and - * the blob scheme, this property should be set to the PKCS#12 data and the + * with a terminating NUL byte. When using PKCS#<!-- -->12 format private keys and + * the blob scheme, this property should be set to the PKCS#<!-- -->12 data and the * #NMSetting8021x:phase2-private-key-password property must be set to - * password used to decrypt the PKCS#12 certificate and key. When using - * PKCS#12 files and the path scheme, this property should be set to the + * password used to decrypt the PKCS#<!-- -->12 certificate and key. When using + * PKCS#<!-- -->12 files and the path scheme, this property should be set to the * full UTF-8 encoded path of the key, prefixed with the string "file://" * and and ending with a terminating NUL byte, and as with the blob scheme * the #NMSetting8021x:phase2-private-key-password property must be set to - * the password used to decode the PKCS#12 private key and certificate. + * the password used to decode the PKCS#<!-- -->12 private key and certificate. * * Setting this property directly is discouraged; use the * nm_setting_802_1x_set_phase2_private_key() function instead. **/ g_object_class_install_property (object_class, PROP_PHASE2_PRIVATE_KEY, - _nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, - "Phase2 private key", - "Contains the 'phase 2' inner private key when " - "the 'phase2-auth' or 'phase2-autheap' property " - "is set to 'tls'. Key data is specified using a " - "'scheme'; two are currently supported: blob and " - "path. When using the blob scheme and private " - "keys, this property should be set to the key's " - "encrypted PEM encoded data. When using private " - "keys with the path scheme, this property should " - "be set to the full UTF-8 encoded path of the key, " - "prefixed with the string 'file://' and ending " - "with a terminating NULL byte. When using " - "PKCS#12 format private keys and the blob " - "scheme, this property should be set to the " - "PKCS#12 data and the 'phase2-private-key-password' " - "property must be set to password used to " - "decrypt the PKCS#12 certificate and key. When " - "using PKCS#12 files and the path scheme, this " - "property should be set to the full UTF-8 encoded " - "path of the key, prefixed with the string " - "'file://' and and ending with a terminating NULL " - "byte, and as with the blob scheme the " - "'phase2-private-key-password' property must be " - "set to the password used to decode the PKCS#12 " - "private key and certificate.", - DBUS_TYPE_G_UCHAR_ARRAY, - G_PARAM_READWRITE)); + _nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, "", "", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase2-private-key-password: * * The password used to decrypt the "phase 2" private key specified in the * #NMSetting8021x:phase2-private-key property when the private key either - * uses the path scheme, or is a PKCS#12 format key. Setting this property + * uses the path scheme, or is a PKCS#<!-- -->12 format key. Setting this property * directly is not generally necessary except when returning secrets to * NetworkManager; it is generally set automatically when setting the * private key by the nm_setting_802_1x_set_phase2_private_key() function. **/ g_object_class_install_property (object_class, PROP_PHASE2_PRIVATE_KEY_PASSWORD, - g_param_spec_string (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, - "Phase2 private key password", - "The password used to decrypt the 'phase 2' private " - "key specified in the 'private-key' property when the " - "phase2 private key either uses the path scheme, or " - "if the phase2 private key is a PKCS#12 format key.", - NULL, - G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET)); + g_param_spec_string (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_SECRET | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:phase2-private-key-password-flags: @@ -3835,15 +3645,14 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) * Flags indicating how to handle the * #NMSetting8021x:phase2-private-key-password property. **/ - g_object_class_install_property (object_class, PROP_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS, - g_param_spec_uint (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS, - "Phase2 Private Key Password Flags", - "Flags indicating how to handle the 802.1x phase2 " - "private key password.", + g_object_class_install_property + (object_class, PROP_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS, + g_param_spec_uint (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS, "", "", NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_SECRET_FLAGS_ALL, NM_SETTING_SECRET_FLAG_NONE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:pin: @@ -3852,25 +3661,25 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_PIN, - g_param_spec_string (NM_SETTING_802_1X_PIN, - "PIN", - "PIN used for EAP authentication methods.", + g_param_spec_string (NM_SETTING_802_1X_PIN, "", "", NULL, - G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET)); + G_PARAM_READWRITE | + NM_SETTING_PARAM_SECRET | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:pin-flags: * * Flags indicating how to handle the #NMSetting8021x:pin property. **/ - g_object_class_install_property (object_class, PROP_PIN_FLAGS, - g_param_spec_uint (NM_SETTING_802_1X_PIN_FLAGS, - "PIN Flags", - "Flags indicating how to handle the 802.1x PIN.", + g_object_class_install_property + (object_class, PROP_PIN_FLAGS, + g_param_spec_uint (NM_SETTING_802_1X_PIN_FLAGS, "", "", NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_SECRET_FLAGS_ALL, NM_SETTING_SECRET_FLAG_NONE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSetting8021x:system-ca-certs: @@ -3884,17 +3693,11 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) **/ g_object_class_install_property (object_class, PROP_SYSTEM_CA_CERTS, - g_param_spec_boolean (NM_SETTING_802_1X_SYSTEM_CA_CERTS, - "Use system CA certificates", - "When TRUE, overrides 'ca-path' and 'phase2-ca-path' " - "properties using the system CA directory " - "specified at configure time with the " - "--system-ca-path switch. The certificates in " - "this directory are added to the verification " - "chain in addition to any certificates specified " - "by the 'ca-cert' and 'phase2-ca-cert' properties.", - FALSE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + g_param_spec_boolean (NM_SETTING_802_1X_SYSTEM_CA_CERTS, "", "", + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); /* Initialize crypto lbrary. */ if (!nm_utils_init (&error)) { @@ -3902,5 +3705,4 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *setting_class) error->code, error->message); g_error_free (error); } - } |