Revision df49d4e1 proto/rip/auth.c

View differences:

proto/rip/auth.c
4 4
 *	Copyright (c) 1999 Pavel Machek <pavel@ucw.cz>
5 5
 *
6 6
 *	Can be freely distributed and used under the terms of the GNU GPL.
7
 *
8 7
 */
9 8

  
10 9
#define LOCAL_DEBUG
......
38 37
      struct password_item *passwd = get_best_password( P_CF->passwords, 0 );
39 38
      DBG( "Plaintext passwd" );
40 39
      if (!passwd) {
41
	log( L_AUTH "no passwords set and password authentication came\n" );
40
	log( L_AUTH "No passwords set and password authentication came" );
42 41
	return 1;
43 42
      }
44 43
      if (strncmp( (char *) (&block->packetlen), passwd->password, 16)) {
45
	log( L_AUTH "Passwd authentication failed!\n" );
44
	log( L_AUTH "Passwd authentication failed!" );
46 45
	DBG( "Expected %s, got %s\n", passwd->password, &block->packetlen );
47 46
	return 1;
48 47
      }
......
55 54
      struct rip_md5_tail *tail;
56 55

  
57 56
      if (block->packetlen != PACKETLEN(num)) {
58
	log( L_ERR "packetlen in md5 does not match computed value\n" );
57
	log( L_ERR "Packet length in MD5 does not match computed value" );
59 58
	return 1;
60 59
      }
61 60

  
62 61
      tail = (struct rip_md5_tail *) ((char *) packet + (block->packetlen - sizeof(struct rip_block_auth)));
63 62
      if ((tail->mustbeFFFF != 0xffff) || (tail->mustbe0001 != 0x0001)) {
64
	log( L_ERR "md5 tail signature is not there\n" );
63
	log( L_ERR "MD5 tail signature is not there" );
65 64
	return 1;
66 65
      }
67 66

  
......
73 72
	if (block->seq) {
74 73
	  struct neighbor *neigh = neigh_find(p, &whotoldme, 0);
75 74
	  if (!neigh) {
76
	    log( L_AUTH "Non-neighbour md5 checksummed packet?\n" );
75
	    log( L_AUTH "Non-neighbour MD5 checksummed packet?" );
77 76
	  } else {
78 77
	    if (neigh->aux > block->seq) {
79
	      log( L_AUTH "md5 prottected packet with lower numbers\n" );
78
	      log( L_AUTH "MD5 protected packet with lower numbers" );
80 79
	      return 0;
81 80
	    }
82 81
	    neigh->aux = block->seq;
......
120 119
  DBG( "Outgoing authentication: " );
121 120

  
122 121
  if (!passwd) {
123
    log( L_ERR "no suitable password found for authentication\n" );
122
    log( L_ERR "No suitable password found for authentication" );
124 123
    return PACKETLEN(num);
125 124
  }
126 125

  
......
137 136
      static int sequence = 0;
138 137

  
139 138
      if (num > PACKET_MD5_MAX)
140
	bug(  "we can not add MD5 authentication to this long packet\n" );
139
	bug(  "We can not add MD5 authentication to this long packet" );
141 140

  
142 141
      block->keyid = passwd->id;
143 142
      block->authlen = 20;
......
157 156
      return PACKETLEN(num) + block->authlen;
158 157
    }
159 158
  default:
160
    bug( "Uknown authtype in outgoing authentication?\n" );
159
    bug( "Unknown authtype in outgoing authentication?" );
161 160
  }
162 161
}

Also available in: Unified diff