Changeset 1567


Ignore:
Timestamp:
04/22/10 16:56:20 (3 years ago)
Author:
salcock
Message:
  • traceanon now replaces checksums with zeroes - TODO: maybe re-calculate checksums to what they would be with the new IP addresses
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/traceanon/traceanon.c

    r1550 r1567  
    208208        for(;;) { 
    209209                struct libtrace_ip *ipptr; 
     210                libtrace_udp_t *udp = NULL; 
     211                libtrace_tcp_t *tcp = NULL; 
     212 
    210213                int psize; 
    211214                psize = trace_read_packet(trace, packet); 
     
    220223                ipptr = trace_get_ip(packet); 
    221224 
    222                 if (ipptr && (enc_source || enc_dest)) 
     225                if (ipptr && (enc_source || enc_dest)) { 
    223226                        encrypt_ips(ipptr,enc_source,enc_dest); 
     227                        ipptr->ip_sum = 0; 
     228                } 
     229 
     230                /* Replace checksums so that IP encryption cannot be 
     231                 * reversed */ 
     232 
     233                /* XXX replace with nice use of trace_get_transport() */ 
     234 
     235                udp = trace_get_udp(packet); 
     236                if (udp && (enc_source || enc_dest)) { 
     237                        udp->check = 0; 
     238                }  
     239 
     240                tcp = trace_get_tcp(packet); 
     241                if (tcp && (enc_source || enc_dest)) { 
     242                        tcp->check = 0; 
     243                } 
    224244 
    225245                /* TODO: Encrypt IP's in ARP packets */ 
Note: See TracChangeset for help on using the changeset viewer.