diff --git a/ChangeLog b/ChangeLog index 6caf5e955..e29bbfd9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-01-23 Dan Williams + + * libnm-util/cipher-private.h + libnm-util/cipher.c + libnm-util/cipher.h + - (cipher_bin2hexstr, cipher_hexstr2bin): make public + 2006-01-23 Robert Love Patch by Timo Hoenig : diff --git a/libnm-util/cipher-private.h b/libnm-util/cipher-private.h index 4bb3cb045..83513c63f 100644 --- a/libnm-util/cipher-private.h +++ b/libnm-util/cipher-private.h @@ -55,11 +55,4 @@ int cipher_default_validate_func (IEEE_802_11_Cipher *cipher, const char *ssid, const char *input); -char * cipher_bin2hexstr (const char *bytes, - int len, - int final_len); - -char * cipher_hexstr2bin (const char *hex, - size_t len); - #endif /* CIPHER_PRIVATE_H */ diff --git a/libnm-util/cipher.c b/libnm-util/cipher.c index c953db2df..25ca7854c 100644 --- a/libnm-util/cipher.c +++ b/libnm-util/cipher.c @@ -151,7 +151,8 @@ cipher_bin2hexstr (const char *bytes, result[2*i+1] = hex_digits[bytes[i] & 0xf]; } /* Cut converted key off at the correct length for this cipher type */ - result[final_len] = '\0'; + if (final_len > -1) + result[final_len] = '\0'; return result; } diff --git a/libnm-util/cipher.h b/libnm-util/cipher.h index 1a7b15594..b1d25fe13 100644 --- a/libnm-util/cipher.h +++ b/libnm-util/cipher.h @@ -36,6 +36,10 @@ int ieee_802_11_cipher_get_input_max (IEEE_802_11_Cipher *cipher); char * ieee_802_11_cipher_hash (IEEE_802_11_Cipher *cipher, const char *ssid, const char *input); int ieee_802_11_cipher_validate (IEEE_802_11_Cipher *cipher, const char *ssid, const char *input); +char * cipher_bin2hexstr (const char *bytes, int len, int final_len); +char * cipher_hexstr2bin(const char *hex, size_t len); + + /* Private API members (not part of the public API) */ int ieee_802_11_cipher_refcount (IEEE_802_11_Cipher *cipher);