[Olsr-cvs] olsrd-current/lib/secure/src md5.c, 1.4, 1.5 olsrd_secure.c, 1.29, 1.30

Bernd Petrovitsch (spam-protected)
Fri Nov 16 23:56:56 CET 2007


Update of /cvsroot/olsrd/olsrd-current/lib/secure/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15005/lib/secure/src

Modified Files:
	md5.c olsrd_secure.c 
Log Message:
* added -Wcast-qual: this killed lots of unnecessary type-casts

Index: md5.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/md5.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** md5.c	2 Nov 2007 15:51:46 -0000	1.4
--- md5.c	16 Nov 2007 22:56:54 -0000	1.5
***************
*** 269,273 ****
    if (inputLen >= partLen) {
      MD5_memcpy
!       ((POINTER)&context->buffer[index], (POINTER)input, partLen);
      MD5Transform (context->state, context->buffer);
    
--- 269,273 ----
    if (inputLen >= partLen) {
      MD5_memcpy
!       ((POINTER)&context->buffer[index], input, partLen);
      MD5Transform (context->state, context->buffer);
    
***************
*** 282,286 ****
    /* Buffer remaining input */
    MD5_memcpy 
!     ((POINTER)&context->buffer[index], (POINTER)&input[i],
       inputLen-i);
  }
--- 282,286 ----
    /* Buffer remaining input */
    MD5_memcpy 
!     ((POINTER)&context->buffer[index], &input[i],
       inputLen-i);
  }

Index: olsrd_secure.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** olsrd_secure.c	8 Nov 2007 22:47:40 -0000	1.29
--- olsrd_secure.c	16 Nov 2007 22:56:54 -0000	1.30
***************
*** 140,144 ****
  static void olsr_event(void);
  #endif
! static int send_challenge(union olsr_ip_addr *);
  static int ifchange(struct interface *, int);
  static int send_cres(union olsr_ip_addr *, union olsr_ip_addr *, olsr_u32_t, struct stamp *);
--- 140,144 ----
  static void olsr_event(void);
  #endif
! static int send_challenge(const union olsr_ip_addr *);
  static int ifchange(struct interface *, int);
  static int send_cres(union olsr_ip_addr *, union olsr_ip_addr *, olsr_u32_t, struct stamp *);
***************
*** 155,160 ****
  static void packet_parser(int);
  static void timeout_timestamps(void*);
! static int check_timestamp(union olsr_ip_addr *, time_t);
! static struct stamp *lookup_timestamp_entry(union olsr_ip_addr *);
  static int read_key_from_file(const char *);
  
--- 155,160 ----
  static void packet_parser(int);
  static void timeout_timestamps(void*);
! static int check_timestamp(const union olsr_ip_addr *, time_t);
! static struct stamp *lookup_timestamp_entry(const union olsr_ip_addr *);
  static int read_key_from_file(const char *);
  
***************
*** 528,532 ****
    int packetsize;
    olsr_u8_t sha1_hash[SIGNATURE_SIZE];
!   struct s_olsrmsg *sig;
    time_t rec_time;
  
--- 528,532 ----
    int packetsize;
    olsr_u8_t sha1_hash[SIGNATURE_SIZE];
!   const struct s_olsrmsg *sig;
    time_t rec_time;
  
***************
*** 543,547 ****
      return 0;
  
!   sig = (struct s_olsrmsg *)&pck[packetsize];
  
    //olsr_printf(1, "Size: %d\n", packetsize);
--- 543,547 ----
      return 0;
  
!   sig = (const struct s_olsrmsg *)&pck[packetsize];
  
    //olsr_printf(1, "Size: %d\n", packetsize);
***************
*** 640,648 ****
    rec_time = ntohl(sig->sig.timestamp);
  
!   if(!check_timestamp((union olsr_ip_addr *)&sig->originator, rec_time))
      {
        struct ipaddr_str buf;
        olsr_printf(1, "[ENC]Timestamp missmatch in packet from %s!\n",
! 		  olsr_ip_to_string(&buf, (union olsr_ip_addr *)&sig->originator));
        return 0;
      }
--- 640,648 ----
    rec_time = ntohl(sig->sig.timestamp);
  
!   if(!check_timestamp((const union olsr_ip_addr *)&sig->originator, rec_time))
      {
        struct ipaddr_str buf;
        olsr_printf(1, "[ENC]Timestamp missmatch in packet from %s!\n",
! 		  olsr_ip_to_string(&buf, (const union olsr_ip_addr *)&sig->originator));
        return 0;
      }
***************
*** 657,661 ****
  
  int
! check_timestamp(union olsr_ip_addr *originator, time_t tstamp)
  {
    struct stamp *entry;
--- 657,661 ----
  
  int
! check_timestamp(const union olsr_ip_addr *originator, time_t tstamp)
  {
    struct stamp *entry;
***************
*** 712,716 ****
  
  int
! send_challenge(union olsr_ip_addr *new_host)
  {
    struct challengemsg cmsg;
--- 712,716 ----
  
  int
! send_challenge(const union olsr_ip_addr *new_host)
  {
    struct challengemsg cmsg;
***************
*** 837,841 ****
  
    /* Now to check the digest from the emitted challenge */
!   if((entry = lookup_timestamp_entry((union olsr_ip_addr *)&msg->originator)) == NULL)
      {
        struct ipaddr_str buf;
--- 837,841 ----
  
    /* Now to check the digest from the emitted challenge */
!   if((entry = lookup_timestamp_entry((const union olsr_ip_addr *)&msg->originator)) == NULL)
      {
        struct ipaddr_str buf;
***************
*** 940,944 ****
  
    /* Now to check the digest from the emitted challenge */
!   if((entry = lookup_timestamp_entry((union olsr_ip_addr *)&msg->originator)) == NULL)
      {
        struct ipaddr_str buf;
--- 940,944 ----
  
    /* Now to check the digest from the emitted challenge */
!   if((entry = lookup_timestamp_entry((const union olsr_ip_addr *)&msg->originator)) == NULL)
      {
        struct ipaddr_str buf;
***************
*** 1014,1018 ****
  
    /* Create entry if not registered */
!   if((entry = lookup_timestamp_entry((union olsr_ip_addr *)&msg->originator)) == NULL)
      {
        entry = malloc(sizeof(struct stamp));
--- 1014,1018 ----
  
    /* Create entry if not registered */
!   if((entry = lookup_timestamp_entry((const union olsr_ip_addr *)&msg->originator)) == NULL)
      {
        entry = malloc(sizeof(struct stamp));
***************
*** 1252,1256 ****
  
  static struct stamp *
! lookup_timestamp_entry(union olsr_ip_addr *adr)
  {
    olsr_u32_t hash;
--- 1252,1256 ----
  
  static struct stamp *
! lookup_timestamp_entry(const union olsr_ip_addr *adr)
  {
    olsr_u32_t hash;





More information about the Olsr-cvs mailing list