[asterisk-commits] tilghman: branch tilghman/str_substitution r175469 - /team/tilghman/str_subst...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 12 18:33:22 CST 2009


Author: tilghman
Date: Thu Feb 12 18:33:21 2009
New Revision: 175469

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=175469
Log:
Unbreak function

Modified:
    team/tilghman/str_substitution/funcs/func_aes.c

Modified: team/tilghman/str_substitution/funcs/func_aes.c
URL: http://svn.digium.com/svn-view/asterisk/team/tilghman/str_substitution/funcs/func_aes.c?view=diff&rev=175469&r1=175468&r2=175469
==============================================================================
--- team/tilghman/str_substitution/funcs/func_aes.c (original)
+++ team/tilghman/str_substitution/funcs/func_aes.c Thu Feb 12 18:33:21 2009
@@ -117,22 +117,22 @@
 	} else {
 		len = INT_MAX;
 	}
+	ast_debug(3, "len=%d\n", len);
 
 	encrypt = strcmp("AES_DECRYPT", cmd);           /* -1 if encrypting, 0 if decrypting */
 	/* Round up the buffer to an even multiple of 16, plus 1 */
 	tmplen = (strlen(args.data) / 16 + 1) * 16 + 1;
 	tmp = ast_calloc(1, tmplen);
+	tmpP = tmp;
 
 	if (encrypt) {                                  /* if decrypting first decode src to base64 */
 		/* encryption:  plaintext -> encryptedtext -> base64 */
 		ast_aes_encrypt_key((unsigned char *) args.key, &ecx);
 		strcpy(tmp, args.data);
 		data_len = strlen(tmp);
-		tmpP = args.data;
 	} else {
 		/* decryption:  base64 -> encryptedtext -> plaintext */
 		ast_aes_decrypt_key((unsigned char *) args.key, &dcx);
-		tmpP = tmp;
 		data_len = ast_base64decode((unsigned char *) tmp, args.data, tmplen);
 	}
 




More information about the asterisk-commits mailing list