diff options
| author | Sjoerd Simons <sjoerd@luon.net> | 2013-10-25 21:20:58 +0200 |
|---|---|---|
| committer | Sjoerd Simons <sjoerd@luon.net> | 2013-10-25 21:20:58 +0200 |
| commit | a4256940da049f91bbbea5e53e469a59ea9c10f7 (patch) | |
| tree | 2211c102aea3a33f34f960f48c8b8a55daccd97b /libnm-util/nm-utils.c | |
| parent | 8d275584fc94f398f0a7c990dcd057533d9a5856 (diff) | |
Imported Upstream version 0.9.8.8 upstream/0.9.8.8
Diffstat (limited to 'libnm-util/nm-utils.c')
| -rw-r--r-- | libnm-util/nm-utils.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index f955afbf..16adb2ba 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -292,7 +292,7 @@ nm_utils_deinit (void) * * Returns: (transfer full): an allocated string containing a UTF-8 * representation of the SSID, which must be freed by the caller using g_free(). - * Returns NULL on errors. + * Returns %NULL on errors. **/ char * nm_utils_ssid_to_utf8 (const GByteArray *ssid) @@ -1432,7 +1432,8 @@ nm_utils_wep_key_valid (const char *key, NMWepKeyType wep_type) return FALSE; keylen = strlen (key); - if (wep_type == NM_WEP_KEY_TYPE_KEY || NM_WEP_KEY_TYPE_UNKNOWN) { + if ( wep_type == NM_WEP_KEY_TYPE_KEY + || wep_type == NM_WEP_KEY_TYPE_UNKNOWN) { if (keylen == 10 || keylen == 26) { /* Hex key */ for (i = 0; i < keylen; i++) { @@ -2211,7 +2212,7 @@ utils_bin2hexstr (const char *bytes, int len, int final_len) * nm_utils_rsa_key_encrypt: * @data: RSA private key data to be encrypted * @in_password: (allow-none): existing password to use, if any - * @out_password: (out) (allow-none): if @in_password was NULL, a random password will be generated + * @out_password: (out) (allow-none): if @in_password was %NULL, a random password will be generated * and returned in this argument * @error: detailed error information on return, if an error occurred * @@ -2758,5 +2759,12 @@ nm_utils_is_uuid (const char *str) p++; } - return (num_dashes == 4) && (p - str == 36); + if ((num_dashes == 4) && (p - str == 36)) + return TRUE; + + /* Backwards compat for older configurations */ + if ((num_dashes == 0) && (p - str == 40)) + return TRUE; + + return FALSE; } |