passwords { password "ahoj" from 0 to 10;
password "nazdar" from 10;
}
- authentication plaintext;
+ authentication md5;
}
protocol device {
struct password_item *head;
struct rip_md5_tail *tail;
- if (block->packetlen != PACKETLEN(num) + 20) {
+ if (block->packetlen != PACKETLEN(num)) {
log( L_ERR "packetlen in md5 does not match computed value\n" );
return 1;
}
MD5Init(&ctxt);
MD5Update(&ctxt, (char *) packet, block->packetlen );
MD5Final((char *) (&tail->md5), &ctxt);
- return block->packetlen;
+ return PACKETLEN(num) + block->authlen;
}
default:
bug( "Uknown authtype in outgoing authentication?\n" );
struct rip_block *block = &packet->block[i];
if (block->family == 0xffff) {
if (i)
- BAD( "Authentication header is not the first" );
+ continue; /* md5 tail has this family */
if (rip_incoming_authentication(p, (void *) block, packet, num))
BAD( "Authentication failed" );
authenticated = 1;
int done;
};
-struct rip_packet_heading {
+struct rip_packet_heading { /* 4 bytes */
u8 command;
#define RIPCMD_REQUEST 1 /* want info */
#define RIPCMD_RESPONSE 2 /* responding to request */