changeset 8482:791c05d1679d

[gaim-migrate @ 9215] This reportedly makes Yahoo auth work on architectures that aren't suck-endian. Thanks, Andrew Wellington. And while I'm thanking people, thanks to Matt Hyclak for helping me test this and many other patches... committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Mon, 22 Mar 2004 01:54:18 +0000
parents 6d0869404696
children 8d3dd39e89ee
files COPYRIGHT src/protocols/yahoo/yahoo.c
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Sun Mar 21 18:38:30 2004 +0000
+++ b/COPYRIGHT	Mon Mar 22 01:54:18 2004 +0000
@@ -127,6 +127,7 @@
 Bjoern Voigt
 Nathan Walp
 Eric Warmenhoven
+Andrew Wellington
 Dan Willemsen
 Jason Willis
 Matt Wilson
--- a/src/protocols/yahoo/yahoo.c	Sun Mar 21 18:38:30 2004 +0000
+++ b/src/protocols/yahoo/yahoo.c	Mon Mar 22 01:54:18 2004 +0000
@@ -1303,7 +1303,7 @@
 	 */
 	
 	memcpy(&magic_key_char[0], comparison_src, 4);
-	memcpy(&magic_4, comparison_src, 4);
+	magic_4 = magic_key_char[0] | (magic_key_char[1]<<8) | (magic_key_char[2]<<16) | (magic_key_char[3]<<24);
 	
 	/* 
 	 * Magic: Phase 4.  Determine what function to use later by getting outside/inside
@@ -1356,7 +1356,10 @@
 		updated_key = yahoo_auth_finalCountdown(magic_4, 0x60, y, x);
 		updated_key = yahoo_auth_finalCountdown(updated_key, 0x60, y, x);
 		
-		memcpy(&magic_key_char[0], &updated_key, 4);
+		magic_key_char[0] = updated_key & 0xff;
+		magic_key_char[1] = (updated_key >> 8) & 0xff;
+		magic_key_char[2] = (updated_key >> 16) & 0xff;
+		magic_key_char[3] = (updated_key >> 24) & 0xff;
 	} 
 	
 /* Get password and crypt hashes as per usual.