Update of /cvsroot/netrek/client/netrekxp/src In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16034/src Modified Files: data.c defaults.c defwin.c feature.c main.c makecyg makefile socket.c Log Message: Remove RSA code from source and makefiles,as it is deprecated. Keep reference in socket code to SP_RSA_KEY and CP_RSA_KEY as these values are fixed server side. Refer to RSA as deprecated in documentation. Index: makecyg =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/makecyg,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- makecyg 28 Feb 2007 12:21:50 -0000 1.3 +++ makecyg 9 May 2009 21:21:43 -0000 1.4 @@ -3,7 +3,6 @@ # #DEBUG = 1 -RSA = 1 # Cygwin cc = gcc @@ -67,15 +66,6 @@ MAINOBJ = main.o MAINSRC = main.c -ifndef RSA -GMPLIB = ..\Win32\lib\libgmp.lib -RSADEFS = -DRSA -RSASRC = rsa_box.c rsa_box_0.c rsa_box_1.c rsa_box_2.c\ - rsa_box_3.c rsa_box_4.c -RSAOBJ = rsa_box.o rsa_box_0.o rsa_box_1.o rsa_box_2.o\ - rsa_box_3.o rsa_box_4.o -endif - WIN32_SRCS = winmain.c mswindow.c WIN32_OBJS = winmain.o mswindow.o @@ -87,9 +77,9 @@ all: netrek.exe -OBJS = $(ROBJ) $(MAINOBJ) $(RSAOBJ) $(INPUTOBJ) $(WIN32_OBJS) +OBJS = $(ROBJ) $(MAINOBJ) $(INPUTOBJ) $(WIN32_OBJS) .c.o: - $(cc) $(cflags) $(ccompileonly) $(cdebug) $(DEFS) $(RSADEFS) $(DEBUGDEFS) $(INCS) $< + $(cc) $(cflags) $(ccompileonly) $(cdebug) $(DEFS) $(DEBUGDEFS) $(INCS) $< RESOURCES = vccnetrek.o Index: makefile =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/makefile,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- makefile 28 Feb 2007 12:21:50 -0000 1.13 +++ makefile 9 May 2009 21:21:43 -0000 1.14 @@ -3,7 +3,6 @@ # DEBUG = 1 -RSA = 1 # Borland C++ 5.5 cc = bcc32 @@ -56,15 +55,6 @@ MAINOBJ = main.obj MAINSRC = main.c -!ifdef RSA -GMPLIB = ..\Win32\lib\BCC\libgmpbcc.lib -RSADEFS = -DRSA -RSASRC = rsa_box.c rsa_box_0.c rsa_box_1.c rsa_box_2.c\ - rsa_box_3.c rsa_box_4.c -RSAOBJ = rsa_box.obj rsa_box_0.obj rsa_box_1.obj rsa_box_2.obj\ - rsa_box_3.obj rsa_box_4.obj -!endif - WIN32_SRCS = winmain.c mswindow.c WIN32_OBJS = winmain.obj mswindow.obj @@ -76,9 +66,9 @@ all: netrek.exe -OBJS = $(ROBJ) $(MAINOBJ) $(RSAOBJ) $(INPUTOBJ) $(WIN32_OBJS) +OBJS = $(ROBJ) $(MAINOBJ) $(INPUTOBJ) $(WIN32_OBJS) .c.obj: - $(cc) $(cflags) $(ccompileonly) $(cdebug) $(DEFS) $(RSADEFS) $(DEBUGDEFS) $(INCS) $< + $(cc) $(cflags) $(ccompileonly) $(cdebug) $(DEFS) $(DEBUGDEFS) $(INCS) $< RESOURCES = bccnetrek.res Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- defaults.c 28 Mar 2009 09:35:38 -0000 1.95 +++ defaults.c 9 May 2009 21:21:43 -0000 1.96 @@ -957,14 +957,6 @@ NULL } }, -#endif -#ifdef RSA - {"useRsa", &useRsa, RC_BOOL, - { - "Use RSA verification", - NULL - } - }, #endif #ifdef VSHIELD_BITMAPS {"varyShields", &varyShields, RC_BOOL, @@ -1711,7 +1703,6 @@ resetdefaults (void) { char *pek; - char tmp[100]; if (strlen (pigcall) == 0) sprintf (pigcall, "Netrek XP 2009 (%s) - the smarter netrek eXPerience!", mvers); @@ -1820,21 +1811,6 @@ warnShields = booleanDefault ("warnShields", warnShields); vary_hull = booleanDefault("warnHull", vary_hull); -#ifdef RSA - if (useRsa >= 0) - { - useRsa = booleanDefault ("useRsa", useRsa); - sprintf (tmp, "useRSA.%s", serverName); - useRsa = booleanDefault (tmp, useRsa); - - } - else - { - /* RSA mode was specified in the command line args */ - useRsa = (useRsa == -2) ? 1 : 0; - } -#endif - #ifdef METAPING metaPing = booleanDefault ("metaPing", metaPing); #endif Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.117 retrieving revision 1.118 diff -u -d -r1.117 -r1.118 --- data.c 15 Mar 2009 12:16:42 -0000 1.117 +++ data.c 9 May 2009 21:21:43 -0000 1.118 @@ -241,12 +241,6 @@ int messageon = 0; -#ifdef RSA -char testdata[16]; -int useRsa = 1; - -#endif - int SBhours = 0; #ifdef SHORT_PACKETS Index: defwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defwin.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- defwin.c 24 Feb 2007 10:19:55 -0000 1.6 +++ defwin.c 9 May 2009 21:21:43 -0000 1.7 @@ -16,63 +16,7 @@ * health and/or system. Its use is at your own risk. I assume no * responsibility for damages, real, potential, or imagined, resulting from * the use of it.) - * - * $Log$ - * Revision 1.6 2007/02/24 10:19:55 modemhero - * Cygwin makefile changes: fixed up a bunch of problems to get build to work, still not - * perfect as libdir not resolving correctly. Also removed CYGWIN define from code and - * placed it as a compiler runtime define. Progress of Cygwin build is that client runs, but - * select() is broken. Most likely related to struct fd_set definition. - * Added observer support for shrink phasers, color phaser, warn and vary shields, and - * removed observer support for detcircle. - * Fixed detcircle so turning it off really does turn it off (oops). - * Fixed color phaser with regards to FPS changes, so it works at all framerates. - * Added observer support for showArmy for locking onto planets. - * Split varyShields into 2 netrekrc options, varyShields and varyShieldsColor, to be - * able to vary either/neither/both shield graphic and shield color with damage. - * Changed defaults for FPS client/server values back to 10 from 50. Let the user - * have it in netrekrc if they want to request a higher rate, and don't assume servers - * are running at 50 FPS. Require that feature packet to be sent to increase the - * update rate. - * - * Revision 1.5 2006/05/14 02:14:54 modemhero - * New planet bitmaps! Using Defcom's art. Changeable via planets menu. - * New netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have - * the choice to change map display planets too! And have map and local planets use different - * bitmap sets - * Fixed bug where map window border wasn't being redrawn on death - * Shortpackets is now off by default. In the current state of internet connectivity, most people - * don't need the reduced packets, which don't send complete information and break certain features - * such as which direction other players are moving, robot shields, observer geno messages, - * shield/cloak status for warp 0 players, etc. - * Fix to problem with bottom and right borders in certain windows (like map) getting overwritten - thanks Stas! - * Client now recognizes planets that are flagged as "core", waiting on server patch to - * actually get this information and do something with it - * - * Revision 1.4 2006/05/07 16:59:27 modemhero - * Major features in this patch are: - * Merge of Stas' latest source into client. - * - Lots of double buffering code - * - Cleanup of protoyping functions and proper variable initialization - * - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) - * - Updated compile instructions, and a new document on how to make a RSA key - * - Working version of winkey with BCC compiler - * - Bug fixes as per listed in his change log - * Cleanup of changes list to remove bug fix/stuff only coders need to know. - * Removal of buildexe script - Stas rewrote build to make this obsolete - * Addition of HR bitmap set (including a few placeholder bitmaps until art is done) - * Metablock patch accepted (not working proper yet though due to retrieving login issue) - * Probably a few other things I forgot about! - * - * Revision 1.2 2004/08/11 00:12:56 stas_p - * replaced printf by more generic console functions fro console.c - * - * Revision 1.2 1999/06/13 05:51:49 sheldon - * Added code for Cambot playback - * - * Revision 1.1.1.1 1999/03/10 06:21:13 sheldon - * Initial public release of Netrek:1999 - * */ + */ #include <stdio.h> #include <signal.h> @@ -405,16 +349,6 @@ ,} ,} , -#ifdef RSA - { - "useRSA", BOOL_DEF, "Use RSA checking", &useRsa, - { - {0, NULL, ""}, - {0, NULL, NULL} - ,} - ,} - , -#endif #ifdef VSHIELD_BITMAPS { "varyShields", BOOL_DEF, "Vary shields based on damage", Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- feature.c 9 Jan 2009 03:34:07 -0000 1.25 +++ feature.c 9 May 2009 21:21:43 -0000 1.26 @@ -5,8 +5,7 @@ /*** March, 1994. Joe Rumsey, Tedd Hadley ***/ /*** ***/ /*** most of the functions needed to handle SP_FEATURE/CP_FEATURE packets. ***/ -/*** fill in the features list below for your client, and add a call to ***/ -/*** reportFeatures just before the RSA response is sent. handleFeature ***/ +/*** fill in the features list below for your client, handleFeature ***/ /*** should just call checkFeature, which will search the list and set the ***/ /*** appropriate variable. features unknown to the server are set to the ***/ /*** desired value for client features, and off for server/client features. ***/ @@ -111,7 +110,6 @@ /******************************************************************************/ /*** reportFeatures() ***/ /******************************************************************************/ -/* call this from handleRSAKey, before sending the response. */ static void reportFeatures (void) { Index: main.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/main.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- main.c 29 Jul 2007 01:38:44 -0000 1.15 +++ main.c 9 May 2009 21:21:43 -0000 1.16 @@ -55,11 +55,6 @@ LineToConsole (" [-H] specify host (via gateway)\n"); #endif -#ifdef RSA - LineToConsole (" [-o] use old style binary verification\n"); - LineToConsole (" [-R] use RSA binary verification\n"); -#endif - #ifdef PACKET_LOG LineToConsole (" [-P] log server packets, repeat for increased information\n"); #endif @@ -246,31 +241,6 @@ break; #endif -#ifdef RSA - case 'o': /* try old binary verification */ - useRsa = -1; /* will be reset leter, set - * negative here * to flag - * that it should override - * xtrekrc */ - LineToConsole ("Using standard binary verification\n"); - break; - - case 'R': /* try RSA verification */ - useRsa = -2; /* will be reset leter, set - * negative here * to flag - * that it should override - * xtrekrc */ - LineToConsole ("Using RSA verification\n"); - break; -#else - case 'R': - LineToConsole ("This client does not support RSA verification\n"); - - case 'o': - LineToConsole ("Using standard binary verification\n"); - break; -#endif - case 'h': /* server to connect to */ if (i < argc && argv[i + 1]) { @@ -362,13 +332,6 @@ case 'v': /* output version info */ LineToConsole ("%s %s\n", version, mvers); LineToConsole ("%s\n", CBUGS); -#ifdef RSA - LineToConsole ("RSA key installed: %s --- Created by: %s\n", key_name, client_creator); - LineToConsole ("Client type: %s\n", client_type); - LineToConsole ("Client arch: %s\n", client_arch); - LineToConsole ("Key permutation date: %s\n", client_key_date); - LineToConsole ("Comments: %s\n", client_comments); -#endif exit (0); break; Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- socket.c 29 Mar 2009 14:59:50 -0000 1.58 +++ socket.c 9 May 2009 21:21:43 -0000 1.59 @@ -133,13 +133,7 @@ {sizeof (struct udp_reply_spacket), handleUdpReply}, /* SP_UDP_STAT */ {sizeof (struct sequence_spacket), handleSequence}, /* SP_SEQUENCE */ {sizeof (struct sc_sequence_spacket), handleSequence}, /* SP_SC_SEQUENCE */ - -#ifdef RSA - {sizeof (struct rsa_key_spacket), handleRSAKey}, /* SP_RSA_KEY */ -#else - {0, dummy}, /* #31, and dummy won't */ -#endif - + {0, dummy}, /* #31, old SP_RSA_KEY */ {-1, handlePacket32}, /* SP_MOTD_PIC and SP_GENERIC_32 */ {-1, handlePacket33}, /* SP_STATS2 and SP_FLAGS_ALL */ {sizeof (struct status_spacket2), handleStatus2}, /* SP_STATUS2 */ @@ -244,13 +238,7 @@ sizeof (struct scan_cpacket), /* CP_SCAN (ATM) */ sizeof (struct udp_req_cpacket), /* CP_UDP_REQ */ sizeof (struct sequence_cpacket), /* CP_SEQUENCE */ - -#ifdef RSA - sizeof (struct rsa_key_cpacket), /* CP_RSA_KEY */ -#else - 0, /* 37 */ -#endif - + 0, /* 37 old CP_RSA_KEY*/ sizeof (struct planet_cpacket), /* CP_PLANET */ 0, /* 39 */ 0, /* 40 */ @@ -2674,41 +2662,9 @@ #endif #if !defined(BORG) - -#ifndef RSA encryptReservedPacket (packet, &response, me->p_no); sendServerPacket ((struct player_spacket *) &response); -#else - - if (useRsa) - { /* can use -o option for old - * blessing */ - /* client sends back a 'reserved' packet just saying RSA_VERSION info */ - /* theoretically, the server then sends off a rsa_key_spacket * for the - * client to then respond to */ - warning (RSA_VERSION); - STRNCPY (response.resp, RSA_VERSION, RESERVED_SIZE); - MCOPY (packet->data, response.data, RESERVED_SIZE); - response.type = CP_RESERVED; - -#ifdef DEBUG - LineToConsole ("Sending RSA reserved response\n"); #endif - } - else - { - /* If server gods don't like NEWMACRO/SMARTMACRO they better install - * RSA... */ - UseNewMacro = 1; - UseSmartMacro = 1; -// SRS - Parameter 3 is incorrect? - encryptReservedPacket (packet, &response, me->p_no); - } - - sendServerPacket ((struct player_spacket *) &response); -#endif /* RSA */ - -#endif /* defined(BORG) */ } /* SP_SHIP_CAP packets are sent frequently by bronco servers but only @@ -2853,76 +2809,6 @@ new_flags(ntohl(packet->flags), packet->offset); } -#ifdef RSA -void -handleRSAKey (struct rsa_key_spacket *packet) -{ - struct rsa_key_cpacket response; - struct sockaddr_in saddr; - int len; - unsigned char *data; - -#ifdef GATEWAY - extern unsigned LONG netaddr; - extern int serv_port; - -#endif - - response.type = CP_RSA_KEY; - /* encryptRSAPacket (packet, &response); old style rsa-client */ - -#ifdef GATEWAY - /* if we didn't get it from -H, go ahead and query the socket */ - if (netaddr == 0) - { - len = sizeof (saddr); - if (getpeername (sock, (struct sockaddr *) &saddr, &len) < 0) - { - perror ("getpeername(sock)"); -#ifdef THREADED - terminate2 (RETURNBASE + 1); -#else - terminate (1); -#endif - } - } - else - { - saddr.sin_addr.s_addr = htonl (netaddr); - saddr.sin_port = htons (serv_port); - } -#else - /* query the socket to determine the remote host (ATM) */ - len = sizeof (saddr); - if (getpeername (sock, (struct sockaddr *) &saddr, &len) < 0) - { - perror ("getpeername(sock)"); -#ifdef THREADED - terminate2 (RETURNBASE + 1); -#else - terminate (1); -#endif - } -#endif - - /* replace the first few bytes of the message */ - /* will be the low order bytes of the number */ - data = packet->data; - MCOPY (&saddr.sin_addr.s_addr, data, sizeof (saddr.sin_addr.s_addr)); - data += sizeof (saddr.sin_addr.s_addr); - MCOPY (&saddr.sin_port, data, sizeof (saddr.sin_port)); - - rsa_black_box (response.resp, packet->data, response.public, - response.global); - - sendServerPacket ((struct player_spacket *) &response); - /* #ifdef DEBUG */ - LineToConsole ("RSA verification requested.\n"); - /* #endif */ -} - -#endif - void initialize_players(void) { @@ -5084,19 +4970,6 @@ LineToConsole(" sequence=%u,", ntohs(((struct sc_sequence_spacket *) packet)->sequence) ); break; -#ifdef RSA - case SP_RSA_KEY : /* handles binary * * - * verification */ - LineToConsole("\nS->C SP_RSA_KEY\t"); - if(log_packets > 1) - { - LineToConsole(" data="); - for(i = 0; i < KEY_SIZE; i++) - LineToConsole("0x%0X ",((struct rsa_key_spacket *) packet)->data[i]); - LineToConsole(","); - } - break; -#endif case SP_GENERIC_32 : //case SP_MOTD_PIC : if (paradise) @@ -5716,27 +5589,6 @@ LineToConsole(" sequence=%u,", ntohs(((struct sequence_cpacket *) packet)->sequence) ); break; -#ifdef RSA - case CP_RSA_KEY : /* handles binary * * - * verification */ - LineToConsole("\nC->S CP_RSA_KEY\t"); - if (log_packets > 1) - { - LineToConsole(" global="); - for(i = 0; i < KEY_SIZE; i++) - LineToConsole("0x%0X ",((struct rsa_key_cpacket *)packet)->global[i]); - fprintf(stderr,","); - LineToConsole(" public="); - for(i = 0; i < KEY_SIZE; i++) - LineToConsole("0x%0X ",((struct rsa_key_cpacket *)packet)->public[i]); - fprintf(stderr,","); - LineToConsole(" resp="); - for(i = 0; i < KEY_SIZE; i++) - LineToConsole("0x%0X ",((struct rsa_key_cpacket *)packet)->resp[i]); - fprintf(stderr,","); - } - break; -#endif case CP_PING_RESPONSE : /* client response */ LineToConsole("\nC->S CP_PING_RESPONSE\t"); if (log_packets > 1)