teatotal: "Read error" building for iPAQ running Linux


Previous by date: 18 Nov 2001 09:54:00 -0000 "Read error" building for iPAQ running Linux, Jay Sekora
Next by date: 18 Nov 2001 09:54:00 -0000 Re: "Read error" building for iPAQ running Linux, Alex Holden
Previous in thread: 18 Nov 2001 09:54:00 -0000 "Read error" building for iPAQ running Linux, Jay Sekora
Next in thread: 18 Nov 2001 09:54:00 -0000 Re: "Read error" building for iPAQ running Linux, Alex Holden

Subject: Re: "Read error" building for iPAQ running Linux
From: Alex Holden ####@####.####
Date: 18 Nov 2001 09:54:00 -0000
Message-Id: <Pine.LNX.4.33.0111180929550.763-100000@hyperspace.linuxhacker.org>

On Mon, 12 Nov 2001, Jay Sekora wrote:
> Hi.  I'm trying to build Tea Total for the Compaq iPAQ running Linux.
> That's a StrongARM-110r4 processor running in little-endian mode.
> There's a /usr/include/asm/types.h which includes the following:

Hi Jay, sorry for taking so long to get back to you. I've run Tea Total on
my NetWinder before, so it ought to work okay on ARM Linux.

> I tried debugging it under gdb.  It's been a while since I really
> understood how to use a debugger, but I *think* what gdb is telling
> me is that the line in read_header() in teaprot.c that reads
>         /* Check for the TEA magic number first */
>         if(memcmp(state->pkt->hdr, TEA_HEADER, HEADER_LEN)) return -1;
> is in fact matching and returning -1.  (I'm afraid I don't understand
> the logic here - it looks to me like the code is checking for "TEA"
> at the beginning of a file, returning -1 when it sees it, and the
> calling code expects -1 to be an error.  But I must be missing something.)

memcmp returns 0 if its arguments match, so that line only returns if the
memcmp returns non zero (ie. the header isn't "TEA"). The first five
letters of your testout.tea file should be "TEA1L", signifying an
uncompressed tea encrypted file with little endian encoding. Can you send
me a copy of your testout.tea? Perhaps you could also set DEBUGGING = Y
and  STATIC = Y in config.inc, then do a "make clean and send me the
resulting "tea" binary itself, and I'll see if I can find out what it's
doing wrong.

PS. I have found one bug since the 0.4 release. It's unlikely to be
causing your problem but you may want to apply this patch anyway:

diff -u tea-total-0.4/getarg.c tea-total-0.4-fixed/getarg.c
--- tea-total-0.4/getarg.c	Mon Jan  1 19:18:54 2001
+++ tea-total-0.4-fixed/getarg.c	Mon Jul  9 17:24:45 2001
@@ -110,7 +110,7 @@

 	/* Copy the arguments, ignoring the first argument (the program name) */
 	for(i = 1; i < argc; i++) {
-		len = strlen(argv[i]);
+		len = strlen(argv[i]) + 1;
 		if(!(state->argv[i - 1] = malloc(len))) {
 			/* It failed, so free the list and return */
 			while(i-- > 1) free(state->argv[i]);

-- 
------- Alex Holden -------
http://www.linuxhacker.org/
 http://www.robogeeks.org/


Previous by date: 18 Nov 2001 09:54:00 -0000 "Read error" building for iPAQ running Linux, Jay Sekora
Next by date: 18 Nov 2001 09:54:00 -0000 Re: "Read error" building for iPAQ running Linux, Alex Holden
Previous in thread: 18 Nov 2001 09:54:00 -0000 "Read error" building for iPAQ running Linux, Jay Sekora
Next in thread: 18 Nov 2001 09:54:00 -0000 Re: "Read error" building for iPAQ running Linux, Alex Holden


Powered by ezmlm-browse 0.20.