/soc/2013/ankitkv/gobjectification: 292fcbdaf528: Merged with de...

Ankit Vani a at nevitus.org
Sat Jun 22 04:52:34 EDT 2013


Changeset: 292fcbdaf5288753d82bc6fe430f097d7f29eaf8
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-06-22 14:19 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/292fcbdaf528

Description:

Merged with default branch

diffstat:

 libpurple/ciphers/des3cipher.c    |  14 ++++++++++++--
 libpurple/ciphers/descipher.c     |   6 ++++++
 pidgin/win32/prepare-workspace.sh |   9 ++++++---
 3 files changed, 24 insertions(+), 5 deletions(-)

diffs (152 lines):

diff --git a/libpurple/ciphers/des3cipher.c b/libpurple/ciphers/des3cipher.c
--- a/libpurple/ciphers/des3cipher.c
+++ b/libpurple/ciphers/des3cipher.c
@@ -112,8 +112,9 @@ purple_des3_cipher_ecb_encrypt(PurpleDES
 	int tmp;
 	guint8 buf[8] = {0,0,0,0,0,0,0,0};
 	ssize_t out_len;
+	PurpleDES3CipherPrivate *priv = PURPLE_DES3_CIPHER_GET_PRIVATE(des3_cipher);
 
-	PurpleDES3CipherPrivate *priv = PURPLE_DES3_CIPHER_GET_PRIVATE(des3_cipher);
+	g_return_val_if_fail(out_size >= in_len, -1);
 
 	while (offset + 8 <= in_len) {
 		purple_des_cipher_ecb_crypt(PURPLE_DES_CIPHER(priv->key1),
@@ -129,6 +130,7 @@ purple_des3_cipher_ecb_encrypt(PurpleDES
 	out_len = in_len;
 	if (offset < in_len) {
 		out_len += in_len - offset;
+		g_return_val_if_fail(out_size >= out_len, -1);
 		tmp = offset;
 		memset(buf, 0, 8);
 		while (tmp < in_len) {
@@ -157,8 +159,9 @@ purple_des3_cipher_cbc_encrypt(PurpleDES
 	guint8 buf[8];
 	ssize_t out_len;
 	PurpleDES3CipherPrivate *priv = PURPLE_DES3_CIPHER_GET_PRIVATE(des3_cipher);
+	memcpy(buf, priv->iv, 8);
 
-	memcpy(buf, priv->iv, 8);
+	g_return_val_if_fail(out_size >= in_len, -1);
 
 	while (offset + 8 <= in_len) {
 		for (i = 0; i < 8; i++)
@@ -178,6 +181,7 @@ purple_des3_cipher_cbc_encrypt(PurpleDES
 	out_len = in_len;
 	if (offset < in_len) {
 		out_len += in_len - offset;
+		g_return_val_if_fail(out_size >= out_len, -1);
 		tmp = offset;
 		i = 0;
 		while (tmp < in_len) {
@@ -225,6 +229,8 @@ purple_des3_cipher_ecb_decrypt(PurpleDES
 	ssize_t out_len;
 	PurpleDES3CipherPrivate *priv = PURPLE_DES3_CIPHER_GET_PRIVATE(des3_cipher);
 
+	g_return_val_if_fail(out_size >= in_len, -1);
+
 	while (offset + 8 <= in_len) {
 		/* NOTE: Apply key in reverse */
 		purple_des_cipher_ecb_crypt(PURPLE_DES_CIPHER(priv->key3),
@@ -240,6 +246,7 @@ purple_des3_cipher_ecb_decrypt(PurpleDES
 	out_len = in_len;
 	if (offset < in_len) {
 		out_len += in_len - offset;
+		g_return_val_if_fail(out_size >= out_len, -1);
 		tmp = offset;
 		memset(buf, 0, 8);
 		while (tmp < in_len) {
@@ -270,6 +277,8 @@ purple_des3_cipher_cbc_decrypt(PurpleDES
 	ssize_t out_len;
 	PurpleDES3CipherPrivate *priv = PURPLE_DES3_CIPHER_GET_PRIVATE(des3_cipher);
 
+	g_return_val_if_fail(out_size >= in_len, -1);
+
 	memcpy(link, priv->iv, 8);
 	while (offset + 8 <= in_len) {
 		purple_des_cipher_ecb_crypt(PURPLE_DES_CIPHER(priv->key3),
@@ -290,6 +299,7 @@ purple_des3_cipher_cbc_decrypt(PurpleDES
 	out_len = in_len;
 	if(offset<in_len) {
 		out_len += in_len - offset;
+		g_return_val_if_fail(out_size >= out_len, -1);
 		tmp = offset;
 		memset(buf, 0, 8);
 		i = 0;
diff --git a/libpurple/ciphers/descipher.c b/libpurple/ciphers/descipher.c
--- a/libpurple/ciphers/descipher.c
+++ b/libpurple/ciphers/descipher.c
@@ -433,6 +433,8 @@ purple_des_cipher_encrypt(PurpleCipher *
 	guint8 buf[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
 	ssize_t out_len;
 
+	g_return_val_if_fail(out_size >= in_len, -1);
+
 	while(offset + 8 <= in_len) {
 		purple_des_cipher_ecb_crypt(des_cipher, input + offset, output + offset, 0);
 		offset += 8;
@@ -442,6 +444,7 @@ purple_des_cipher_encrypt(PurpleCipher *
 
 	if(offset<in_len) {
 		out_len += in_len - offset;
+		g_return_val_if_fail(out_size >= out_len, -1);
 		tmp = offset;
 		while(tmp<in_len) {
 			buf[i++] = input[tmp];
@@ -463,6 +466,8 @@ purple_des_cipher_decrypt(PurpleCipher *
 	guint8 buf[8] = {0,0,0,0,0,0,0,0};
 	ssize_t out_len;
 
+	g_return_val_if_fail(out_size >= in_len, -1);
+
 	while(offset + 8 <= in_len) {
 		purple_des_cipher_ecb_crypt(des_cipher, input + offset, output + offset, 1);
 		offset += 8;
@@ -471,6 +476,7 @@ purple_des_cipher_decrypt(PurpleCipher *
 	out_len = in_len;
 	if(offset<in_len) {
 		out_len += in_len - offset;
+		g_return_val_if_fail(out_size >= out_len, -1);
 		tmp = offset;
 		while(tmp<in_len) {
 			buf[i++] = input[tmp];
diff --git a/pidgin/win32/prepare-workspace.sh b/pidgin/win32/prepare-workspace.sh
--- a/pidgin/win32/prepare-workspace.sh
+++ b/pidgin/win32/prepare-workspace.sh
@@ -6,7 +6,7 @@
 
 # configuration
 
-BONJOUR_GUID_PACKED="5CA28B3B1DEA7654999C464610C010EB"
+BONJOUR_GUID_PACKED="5CA28B3B1DEA7654999C464610C010EB 2EA34582882FE334694F0BCD7D8DE336"
 ACTIVEPERL_GUID_PACKED="BC98F31FB8440B94CB3674649419766C 547A2C684F806164DB756F228DAB5840 5E7EC16051106BB43818746C209BC8D7"
 PERL_DIR_FALLBACK="/cygdrive/c/Perl/bin"
 NSIS_DIR_REGKEY="HKEY_LOCAL_MACHINE/SOFTWARE/NSIS/@"
@@ -153,6 +153,9 @@ function path_real() {
 function reg_get_path() {
 	reg_ret=""
 	reg_key="/proc/registry/$1"
+	if [ ! -f $reg_key ] ; then
+		reg_key="/proc/registry64/$1"
+	fi
 	if [ -f $reg_key ] ; then
 		path_win32_to_cygwin "`cat ${reg_key}`"
 		reg_ret="${path_ret}"
@@ -325,7 +328,7 @@ if [ ! -e "${PIDGIN_BASE}/ChangeLog" ]; 
 fi
 
 if [ -e "$WIN32DEV_BASE" ] && [ $DEBUG_SKIP_INSTALL == 0 ]; then
-	echo "win32-dev directory exists, please remove it before proceeding"
+	echo "win32-dev directory ($(readlink -f $WIN32DEV_BASE)) exists, please remove it before proceeding"
 	exit 1
 fi
 
@@ -343,7 +346,7 @@ reg_get_install_path "$BONJOUR_GUID_PACK
 BONJOUR_SDK_DIR=$reg_ret
 
 if [ "$BONJOUR_SDK_DIR" == "" ]; then
-	echo "Bonjour SDK for Windows v3.0 is not installed, please do it."
+	echo "Bonjour SDK for Windows v3.0/v2.0.4 is not installed, please do it."
 	echo "You can download this SDK from https://developer.apple.com/bonjour/"
 	echo "(Apple ID may be required)."
 	exit 1;



More information about the Commits mailing list