/dev/tomkiewicz/new-smileys: 7a8d87b4e516: Merge default

Tomasz Wasilczyk twasilczyk at pidgin.im
Thu Apr 3 10:30:54 EDT 2014


Changeset: 7a8d87b4e516da24c67926043d59033cb18ec0f5
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-04-03 16:30 +0200
Branch:	 default
URL: https://hg.pidgin.im/dev/tomkiewicz/new-smileys/rev/7a8d87b4e516

Description:

Merge default

diffstat:

 COPYRIGHT                                      |      3 +
 ChangeLog                                      |      4 +
 configure.ac                                   |      2 +-
 libpurple/account.h                            |     41 +-
 libpurple/certificate.h                        |     26 +-
 libpurple/ciphers/aescipher.c                  |    103 +-
 libpurple/cmds.h                               |     65 +-
 libpurple/dnsquery.h                           |      2 +-
 libpurple/dnssrv.h                             |     20 +-
 libpurple/e2ee.h                               |      2 +-
 libpurple/eventloop.h                          |     16 +-
 libpurple/http.h                               |     30 +-
 libpurple/internal.h                           |     19 +
 libpurple/keyring.h                            |     78 +-
 libpurple/memorypool.c                         |      2 +-
 libpurple/network.c                            |     59 +-
 libpurple/network.h                            |     58 +-
 libpurple/notify.h                             |     41 +-
 libpurple/ntlm.c                               |     17 +-
 libpurple/plugin.h                             |      5 +-
 libpurple/plugins/tcl/tcl_glib.c               |      3 +-
 libpurple/pounce.h                             |      2 +-
 libpurple/prefs.h                              |      2 +-
 libpurple/protocols/bonjour/bonjour_ft.c       |      7 +-
 libpurple/protocols/bonjour/jabber.c           |     46 +-
 libpurple/protocols/gg/lib/common.c            |     26 +-
 libpurple/protocols/gg/lib/dcc7.c              |      5 +-
 libpurple/protocols/gg/lib/events.c            |     15 +-
 libpurple/protocols/gg/lib/handlers.c          |      6 +-
 libpurple/protocols/gg/lib/internal.h          |     14 +-
 libpurple/protocols/gg/lib/libgadu.h           |      2 +-
 libpurple/protocols/gg/lib/network.h           |      2 +
 libpurple/protocols/gg/lib/protobuf-c.c        |     12 +-
 libpurple/protocols/gg/lib/resolver.c          |     15 +-
 libpurple/protocols/gg/lib/sha1.c              |     16 +-
 libpurple/protocols/gg/resolver-purple.c       |     20 +-
 libpurple/protocols/irc/dcc_send.c             |      4 +-
 libpurple/protocols/jabber/disco.c             |     14 +-
 libpurple/protocols/jabber/google/jingleinfo.c |     14 +-
 libpurple/protocols/msn/directconn.c           |     12 +-
 libpurple/protocols/msn/msnutils.c             |     54 +-
 libpurple/protocols/msn/p2p.c                  |      8 +-
 libpurple/protocols/msn/slpcall.c              |     18 +-
 libpurple/protocols/msn/tlv.c                  |      2 +-
 libpurple/protocols/msn/tlv.h                  |      2 +-
 libpurple/protocols/mxit/Makefile.am           |      6 +-
 libpurple/protocols/mxit/actions.c             |      2 +-
 libpurple/protocols/mxit/aes.c                 |    405 -
 libpurple/protocols/mxit/aes.h                 |     39 -
 libpurple/protocols/mxit/chunk.c               |     16 +-
 libpurple/protocols/mxit/chunk.h               |      3 +-
 libpurple/protocols/mxit/cipher.c              |    272 +-
 libpurple/protocols/mxit/cipher.h              |     29 +-
 libpurple/protocols/mxit/login.c               |      2 +-
 libpurple/protocols/mxit/protocol.c            |     24 +-
 libpurple/protocols/silc/buddy.c               |      2 +
 libpurple/protocols/silc/chat.c                |      2 +
 libpurple/protocols/silc/ft.c                  |      2 +
 libpurple/protocols/silc/ops.c                 |      2 +
 libpurple/protocols/silc/pk.c                  |      2 +
 libpurple/protocols/silc/silc.c                |      2 +
 libpurple/protocols/silc/util.c                |      2 +
 libpurple/protocols/silc/wb.c                  |      2 +
 libpurple/protocols/yahoo/libymsg.c            |      2 +-
 libpurple/protocols/yahoo/libymsg.h            |      2 +-
 libpurple/proxy.c                              |     47 +-
 libpurple/proxy.h                              |     48 +-
 libpurple/stun.c                               |     63 +-
 libpurple/win32/wpurpleerror.h                 |      2 +
 pidgin/gtkconv.c                               |      5 +-
 pidgin/gtkdialogs.c                            |      8 +-
 pidgin/gtkwebview.h                            |     13 +-
 pidgin/gtkxfer.c                               |     39 +
 pidgin/gtkxfer.h                               |      9 +
 po/de.po                                       |    312 +-
 po/lv.po                                       |  19813 +++++++++++++++++++++++
 po/tt.po                                       |  19755 ++++++++++++++++++++++
 77 files changed, 40556 insertions(+), 1290 deletions(-)

diffs (truncated from 43768 to 300 lines):

diff --git a/COPYRIGHT b/COPYRIGHT
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -340,6 +340,7 @@ John Matthews
 Simo Mattila
 Robert Matusewicz
 Michal Matyska
+Rudolfs Mazurs
 Ryan McCabe
 Peter McCurdy
 Kurt McKee
@@ -568,6 +569,8 @@ Max Ulidtko
 Dmitry Utkin
 Igor Vlasenko
 István Váradi
+ILDAR Valeev
+Cédric Valmary
 Martijn van Beers
 Gideon van Melle
 Arjan van de Ven
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -75,6 +75,10 @@ version 2.10.10 (?/?/?):
 	Gadu-Gadu:
 	* Updated internal libgadu to version 1.12.0-rc2.
 
+	Windows-Specific Changes:
+	* Updates to dependencies:
+		* NSS 3.16 and NSPR 4.10.4
+
 version 2.10.9 (2/2/2014):
 	XMPP:
 	* Fix problems logging into some servers including jabber.org and
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -305,7 +305,7 @@ if test x$enable_i18n = xyes; then
 	GETTEXT_PACKAGE=pidgin
 	AC_SUBST(GETTEXT_PACKAGE)
 
-	ALL_LINGUAS="af am ar ast az be at latin bg bn bn_IN bs ca ca at valencia cs da de dz el en_AU en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu id it ja ka kk km kn ko ku lt mai mhr mk mn mr my_MM nb ne nl nn oc or pa pl pt_BR pt ps ro ru si sk sl sq sr sr at latin sv sw ta te th tr uk ur vi xh zh_CN zh_HK zh_TW"
+	ALL_LINGUAS="af am ar ast az be at latin bg bn bn_IN bs ca ca at valencia cs da de dz el en_AU en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu id it ja ka kk km kn ko ku lt lv mai mhr mk mn mr my_MM nb ne nl nn oc or pa pl pt_BR pt ps ro ru si sk sl sq sr sr at latin sv sw ta te th tr tt uk ur vi xh zh_CN zh_HK zh_TW"
 	AM_GLIB_GNU_GETTEXT
 
 	dnl If we don't have msgfmt, then po/ is going to fail -- ensure that
diff --git a/libpurple/account.h b/libpurple/account.h
--- a/libpurple/account.h
+++ b/libpurple/account.h
@@ -160,9 +160,9 @@ void purple_account_connect(PurpleAccoun
 
 /**
  * purple_account_set_register_callback:
- * @account:	The account for which this callback should be used
- * @cb:	The callback
- * @user_data:	The user data passed to the callback
+ * @account:	      The account for which this callback should be used
+ * @cb: (scope call): The callback
+ * @user_data:	      The user data passed to the callback
  *
  * Sets the callback for successful registration.
  */
@@ -189,8 +189,9 @@ void purple_account_register_completed(P
 /**
  * purple_account_unregister:
  * @account: The account to unregister.
- * @cb: Optional callback to be called when unregistration is complete
- * @user_data: user data to pass to the callback
+ * @cb: (scope call): Optional callback to be called when unregistration is
+ *                    complete
+ * @user_data:        user data to pass to the callback
  *
  * Unregisters an account (deleting it from the server).
  */
@@ -260,8 +261,8 @@ void purple_account_request_add(PurpleAc
  * @alias:        The optional alias of the remote user.
  * @message:      The optional message sent by the user wanting to add you.
  * @on_list:      Is the remote user already on the buddy list?
- * @auth_cb:      The callback called when the local user accepts
- * @deny_cb:      The callback called when the local user rejects
+ * @auth_cb:      (scope call): The callback called when the local user accepts
+ * @deny_cb:      (scope call): The callback called when the local user rejects
  * @user_data:    Data to be passed back to the above callbacks
  *
  * Notifies the user that a remote user has wants to add the local user
@@ -295,8 +296,8 @@ void purple_account_request_close(void *
 /**
  * purple_account_request_password:
  * @account:     The account to request the password for.
- * @ok_cb:       The callback for the OK button.
- * @cancel_cb:   The callback for the cancel button.
+ * @ok_cb:       (scope call): The callback for the OK button.
+ * @cancel_cb:   (scope call): The callback for the cancel button.
  * @user_data:   User data to be passed into callbacks.
  *
  * Requests a password from the user for the account. Does not set the
@@ -335,7 +336,7 @@ void purple_account_set_username(PurpleA
  * purple_account_set_password:
  * @account:  The account.
  * @password: The password.
- * @cb:       A callback for once the password is saved.
+ * @cb:       (scope call): A callback for once the password is saved.
  * @data:     A pointer to be passed to the callback.
  *
  * Sets the account's password.
@@ -494,12 +495,12 @@ void purple_account_set_status_list(Purp
  * purple_account_set_public_alias:
  * @account:    The account
  * @alias:      The new public alias for this account or %NULL
- *                   to unset the alias/nickname (or return it to
- *                   a protocol-specific "default", like the username)
- * @success_cb: A callback which will be called if the alias
- *                   is successfully set on the server (or %NULL).
- * @failure_cb: A callback which will be called if the alias
- *                   is not successfully set on the server (or %NULL).
+ *              to unset the alias/nickname (or return it to
+ *              a protocol-specific "default", like the username)
+ * @success_cb: (scope call): A callback which will be called if the alias
+ *              is successfully set on the server (or %NULL).
+ * @failure_cb: (scope call): A callback which will be called if the alias
+ *              is not successfully set on the server (or %NULL).
  *
  * Set a server-side (public) alias for this account.  The account
  * must already be connected.
@@ -514,9 +515,9 @@ void purple_account_set_public_alias(Pur
 /**
  * purple_account_get_public_alias:
  * @account:    The account
- * @success_cb: A callback which will be called with the alias
- * @failure_cb: A callback which will be called if the protocol is
- *                   unable to retrieve the server-side alias.
+ * @success_cb: (scope call): A callback which will be called with the alias
+ * @failure_cb: (scope call): A callback which will be called if the protocol is
+ *              unable to retrieve the server-side alias.
  *
  * Fetch the server-side (public) alias for this account.  The account
  * must already be connected.
@@ -694,7 +695,7 @@ const char *purple_account_get_username(
 /**
  * purple_account_get_password:
  * @account: The account.
- * @cb:      The callback to give the password.
+ * @cb:      (scope call): The callback to give the password.
  * @data:    A pointer passed to the callback.
  *
  * Reads the password for the account.
diff --git a/libpurple/certificate.h b/libpurple/certificate.h
--- a/libpurple/certificate.h
+++ b/libpurple/certificate.h
@@ -363,19 +363,19 @@ G_BEGIN_DECLS
 
 /**
  * purple_certificate_verify:
- * @verifier:      Verification logic to use.
- *                      See purple_certificate_find_verifier().
- * @subject_name:  Name that should match the first certificate in the
- *                      chain for the certificate to be valid. Will be strdup'd
- *                      into the Request struct
- * @cert_chain:    Certificate chain to check. If there is more than one
- *                      certificate in the chain (X.509), the peer's
- *                      certificate comes first, then the issuer/signer's
- *                      certificate, etc. The whole list is duplicated into the
- *                      Request struct.
- * @cb:            Callback function to be called with whether the
- *                      certificate was approved or not.
- * @cb_data:       User-defined data for the above.
+ * @verifier:         Verification logic to use.
+ *                    See purple_certificate_find_verifier().
+ * @subject_name:     Name that should match the first certificate in the
+ *                    chain for the certificate to be valid. Will be strdup'd
+ *                    into the Request struct
+ * @cert_chain:       Certificate chain to check. If there is more than one
+ *                    certificate in the chain (X.509), the peer's
+ *                    certificate comes first, then the issuer/signer's
+ *                    certificate, etc. The whole list is duplicated into the
+ *                    Request struct.
+ * @cb: (scope call): Callback function to be called with whether the
+ *                    certificate was approved or not.
+ * @cb_data:          User-defined data for the above.
  *
  * Constructs a verification request and passed control to the specified Verifier
  *
diff --git a/libpurple/ciphers/aescipher.c b/libpurple/ciphers/aescipher.c
--- a/libpurple/ciphers/aescipher.c
+++ b/libpurple/ciphers/aescipher.c
@@ -58,6 +58,7 @@ typedef struct {
 	guchar key[32];
 	guint key_size;
 	gboolean failure;
+	PurpleCipherBatchMode batch_mode;
 } PurpleAESCipherPrivate;
 
 /******************************************************************************
@@ -82,7 +83,8 @@ static GParamSpec *properties[PROP_LAST]
 
 typedef gboolean (*purple_aes_cipher_crypt_func)(
 	const guchar *input, guchar *output, size_t len,
-	guchar iv[PURPLE_AES_BLOCK_SIZE], guchar key[32], guint key_size);
+	guchar iv[PURPLE_AES_BLOCK_SIZE], guchar key[32], guint key_size,
+	PurpleCipherBatchMode batch_mode);
 
 static void
 purple_aes_cipher_reset(PurpleCipher *cipher)
@@ -232,11 +234,32 @@ purple_aes_cipher_gnutls_crypt_init(guch
 
 static gboolean
 purple_aes_cipher_gnutls_encrypt(const guchar *input, guchar *output, size_t len,
-	guchar iv[PURPLE_AES_BLOCK_SIZE], guchar key[32], guint key_size)
+	guchar iv[PURPLE_AES_BLOCK_SIZE], guchar key[32], guint key_size,
+	PurpleCipherBatchMode batch_mode)
 {
 	gnutls_cipher_hd_t handle;
 	int ret;
 
+	/* We have to simulate ECB mode, which is not supported by GnuTLS. */
+	if (batch_mode == PURPLE_CIPHER_BATCH_MODE_ECB) {
+		size_t i;
+		for (i = 0; i < len / PURPLE_AES_BLOCK_SIZE; i++) {
+			int offset = i * PURPLE_AES_BLOCK_SIZE;
+			guchar iv_local[PURPLE_AES_BLOCK_SIZE];
+			gboolean succ;
+
+			memcpy(iv_local, iv, sizeof(iv_local));
+			succ = purple_aes_cipher_gnutls_encrypt(
+				input + offset, output + offset,
+				PURPLE_AES_BLOCK_SIZE,
+				iv_local, key, key_size,
+				PURPLE_CIPHER_BATCH_MODE_CBC);
+			if (!succ)
+				return FALSE;
+		}
+		return TRUE;
+	}
+
 	handle = purple_aes_cipher_gnutls_crypt_init(iv, key, key_size);
 	if (handle == NULL)
 		return FALSE;
@@ -255,11 +278,32 @@ purple_aes_cipher_gnutls_encrypt(const g
 
 static gboolean
 purple_aes_cipher_gnutls_decrypt(const guchar *input, guchar *output, size_t len,
-	guchar iv[PURPLE_AES_BLOCK_SIZE], guchar key[32], guint key_size)
+	guchar iv[PURPLE_AES_BLOCK_SIZE], guchar key[32], guint key_size,
+	PurpleCipherBatchMode batch_mode)
 {
 	gnutls_cipher_hd_t handle;
 	int ret;
 
+	/* We have to simulate ECB mode, which is not supported by GnuTLS. */
+	if (batch_mode == PURPLE_CIPHER_BATCH_MODE_ECB) {
+		size_t i;
+		for (i = 0; i < len / PURPLE_AES_BLOCK_SIZE; i++) {
+			int offset = i * PURPLE_AES_BLOCK_SIZE;
+			guchar iv_local[PURPLE_AES_BLOCK_SIZE];
+			gboolean succ;
+
+			memcpy(iv_local, iv, sizeof(iv_local));
+			succ = purple_aes_cipher_gnutls_decrypt(
+				input + offset, output + offset,
+				PURPLE_AES_BLOCK_SIZE,
+				iv_local, key, key_size,
+				PURPLE_CIPHER_BATCH_MODE_CBC);
+			if (!succ)
+				return FALSE;
+		}
+		return TRUE;
+	}
+
 	handle = purple_aes_cipher_gnutls_crypt_init(iv, key, key_size);
 	if (handle == NULL)
 		return FALSE;
@@ -305,10 +349,9 @@ purple_aes_cipher_nss_cleanup(PurpleAESC
 static gboolean
 purple_aes_cipher_nss_crypt(const guchar *input, guchar *output, size_t len,
 	guchar iv[PURPLE_AES_BLOCK_SIZE], guchar key[32], guint key_size,
-	CK_ATTRIBUTE_TYPE operation)
+	CK_ATTRIBUTE_TYPE operation, CK_MECHANISM_TYPE cipher_mech)
 {
 	PurpleAESCipherNSSContext context;
-	CK_MECHANISM_TYPE cipher_mech = CKM_AES_CBC;
 	SECItem key_item, iv_item;
 	SECStatus ret;
 	int outlen = 0;
@@ -385,28 +428,41 @@ purple_aes_cipher_nss_crypt(const guchar
 	outlen += outlen_tmp;
 	if (outlen != (int)len) {
 		purple_debug_error("cipher-aes",
-			"resulting length doesn't match: %d (expected: %lu)\n",
-			outlen, len);
+			"resulting length doesn't match: %d (expected: %"
+			G_GSIZE_FORMAT ")\n", outlen, len);
 		return FALSE;
 	}
 
 	return TRUE;
 }
 
+static CK_MECHANISM_TYPE
+purple_aes_cipher_nss_batch_mode(PurpleCipherBatchMode batch_mode)
+{



More information about the Commits mailing list