diff options
author | Ankit Vani <a@nevitus.org> | 2013-06-15 22:54:05 +0530 |
---|---|---|
committer | Ankit Vani <a@nevitus.org> | 2013-06-15 22:54:05 +0530 |
commit | 3c8a5e420a4534c4a7100d271de0ba6e942d0f4b (patch) | |
tree | e46a4d5717a4660c44ca7312c5c86b9330a31acb /libpurple/ciphers | |
parent | 1fbef1e85448f6c8cc96f84dabfeda6b6e9e71d2 (diff) | |
download | pidgin-3c8a5e420a4534c4a7100d271de0ba6e942d0f4b.tar.gz |
Removed finalize from PurpleCipher, and fixed appropriate finalize methods for ciphers that need it
Diffstat (limited to 'libpurple/ciphers')
-rw-r--r-- | libpurple/ciphers/hmac.c | 2 | ||||
-rw-r--r-- | libpurple/ciphers/pbkdf2.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libpurple/ciphers/hmac.c b/libpurple/ciphers/hmac.c index f6299177fd..3dbaa78257 100644 --- a/libpurple/ciphers/hmac.c +++ b/libpurple/ciphers/hmac.c @@ -263,6 +263,8 @@ purple_hmac_cipher_finalize(GObject *obj) { PurpleCipher *cipher = PURPLE_CIPHER(obj); PurpleHMACCipherPrivate *priv = PURPLE_HMAC_CIPHER_GET_PRIVATE(cipher); + purple_hmac_cipher_reset(cipher); + if (priv->hash != NULL) g_object_unref(priv->hash); diff --git a/libpurple/ciphers/pbkdf2.c b/libpurple/ciphers/pbkdf2.c index 4d078f986d..a2c59ac4aa 100644 --- a/libpurple/ciphers/pbkdf2.c +++ b/libpurple/ciphers/pbkdf2.c @@ -85,8 +85,8 @@ purple_pbkdf2_cipher_reset(PurpleCipher *cipher) g_return_if_fail(priv != NULL); - g_object_unref(priv->hash); - priv->hash = NULL; + if(PURPLE_IS_CIPHER(priv->hash)) + purple_cipher_reset(priv->hash); priv->iter_count = 1; priv->out_len = 256; @@ -316,6 +316,8 @@ purple_pbkdf2_cipher_finalize(GObject *obj) PurpleCipher *cipher = PURPLE_CIPHER(obj); PurplePBKDF2CipherPrivate *priv = PURPLE_PBKDF2_CIPHER_GET_PRIVATE(cipher); + purple_pbkdf2_cipher_reset(cipher); + if (priv->hash != NULL) g_object_unref(priv->hash); |