libpurple/protocols/mxit/cipher.c

branch
soc.2008.masterpassword
changeset 34108
7a07b6857540
parent 34024
9155cf9d26fa
parent 33558
8564519d01c0
child 34111
85b5efb9a873
--- a/libpurple/protocols/mxit/cipher.c	Thu Aug 23 01:27:48 2012 -0400
+++ b/libpurple/protocols/mxit/cipher.c	Fri Jan 25 02:22:38 2013 -0500
@@ -163,6 +163,10 @@
 	/* base64 decode the message */
 	raw_message = purple_base64_decode( message, &raw_len );
 
+	/* AES-encrypted data is always blocks of 16 bytes */
+	if ( ( raw_len == 0 ) || ( raw_len % 16 != 0 ) )
+		return NULL;
+
 	/* build the AES key */
 	ExpandKey( (unsigned char*) transport_layer_key( session ), (unsigned char*) exkey );
 

mercurial