Package: jabber-yahoo Severity: important Tags: sarge patch this might be specific to the amd64 architecture, but i figure it's a problem on any platform where sizeof(long) = 8.
in migrating my jabber server from woody on 386 (using personal backports) to sarge on amd64, the yahoo transport broke. using a constant seed, peppering the code with printfs, and comparing the output on both platforms, i traced the problem to the sha algorithm in gaim-sha.[hc]. in the current jabber-yahoo version, the GAIM_SHA_CTX struct uses unsigned longs (32 bits on 386, 64 bits on AMD64). the latest/last version in gaim cvs uses guint32 (from glib), which i presume is explicitly 32 bits regardless of platform. plus gaim's version includes proper copyright attribution and explicit licensing. doing nothing more than using gaim's sha.h and appending "gaim_" or "GAIM_" where necessary to match the original version fixed the problem. thanks for maintaining jabber-yahoo.
diff -urNp jabber-yahoo-2.3.2/debian/changelog jabber-yahoo-2.3.2.fix/debian/changelog --- jabber-yahoo-2.3.2/debian/changelog 2005-12-28 07:24:49.449918147 +0000 +++ jabber-yahoo-2.3.2.fix/debian/changelog 2005-12-28 07:24:16.695029112 +0000 @@ -1,3 +1,10 @@ +jabber-yahoo (2.3.2-1.1) stable; urgency=low + + * make gaim-sha.[hc] work on AMD64 by using glib's 32-bit type + http://cvs.sourceforge.net/viewcvs.py/*checkout*/gaim/gaim/src/Attic/sha.h + + -- Corey Wright <[EMAIL PROTECTED]> Wed, 28 Dec 2005 01:20:32 -0600 + jabber-yahoo (2.3.2-1) unstable; urgency=low * new upstream version (Closes: #258255) diff -urNp jabber-yahoo-2.3.2/gaim-sha.h jabber-yahoo-2.3.2.fix/gaim-sha.h --- jabber-yahoo-2.3.2/gaim-sha.h 2003-09-28 17:30:47.000000000 +0000 +++ jabber-yahoo-2.3.2.fix/gaim-sha.h 2005-12-28 07:09:40.966517000 +0000 @@ -1,22 +1,41 @@ -/* -#if (SIZEOF_INT == 4) -typedef unsigned int uint32; -#elif (SIZEOF_SHORT == 4) -typedef unsigned short uint32; -#else -typedef unsigned int uint32; -#endif HAVEUINT32 */ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is SHA 180-1 Reference Implementation (Compact version) + * + * The Initial Developer of the Original Code is Paul Kocher of + * Cryptography Research. Portions created by Paul Kocher are + * Copyright (C) 1995-9 by Cryptography Research, Inc. All + * Rights Reserved. + * + * Contributor(s): + * + */ +#ifndef _GAIM_SHA_H_ +#define _GAIM_SHA_H_ + +#include <glib.h> -int strprintsha(char *dest, int *hashval); - typedef struct { - unsigned long H[5]; - unsigned long W[80]; - int lenW; - unsigned long sizeHi,sizeLo; + guint32 H[5]; + guint32 W[80]; + int lenW; + guint32 sizeHi; + guint32 sizeLo; } GAIM_SHA_CTX; - + +int strprintsha(char *dest, int *hashval); void gaim_shaInit(GAIM_SHA_CTX *ctx); void gaim_shaUpdate(GAIM_SHA_CTX *ctx, unsigned char *dataIn, int len); void gaim_shaFinal(GAIM_SHA_CTX *ctx, unsigned char hashout[20]); void gaim_shaBlock(unsigned char *dataIn, int len, unsigned char hashout[20]); + +#endif /* _GAIM_SHA_H_ */

