> On Wed, Nov 15, 2006 at 01:05:51PM +0100, Narcis wrote:
>> can anyone enlighten me? it looks like the address (ip?) and port of
>> the client (server?) are used in the decryption of the rsa key.
>
> Yes.  The first few bytes of the message are replaced with the  
> unencoded
> 32-bit IPv4 address of the server, and the port number, both of which
> were obtained using getpeername.

okay so 66.11.161.166 would put 66 in byte 0, 11 in byte 1 etc

and the port 0x1234 would put 0x12 in byte 4 and 0x34 in byte 5?

> This may be a misguided attempt to increase the difficulty of
> man-in-the-middle attack on the scheme, written in the days when it
> wasn't trivial to do network address translation.

hmm i think it will be something like :

hostName = [ONHost hostForHostname:@"netrek.pulsar-zone.net"];
ONHostAddress *address = [[hostName addresses] objectAtIndex:0];
char *p = [[address addressData] bytes];

then copy the first 4 bytes.

should work unless it get's more then one interface returned for
the host. Which can only happen when you run the app on the server.

regards

Chris


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.us.netrek.org/pipermail/netrek-dev/attachments/20061117/69241605/attachment.htm