summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>1999-11-25 16:03:12 +0100
committerPavel Machek <pavel@ucw.cz>1999-11-25 16:03:12 +0100
commit1a509a6310cb2a5211bf3ac9fd963f06d9109cb1 (patch)
tree20f0c934acd44acd6ec17df927ef326bdb5c4c6f
parentd3702d57fd5357e9a11ada6c46769a79da8e547a (diff)
downloadbird-1a509a6310cb2a5211bf3ac9fd963f06d9109cb1.tar
bird-1a509a6310cb2a5211bf3ac9fd963f06d9109cb1.zip
md5 authentication seems to work.
-rw-r--r--bird.conf2
-rw-r--r--proto/rip/auth.c4
-rw-r--r--proto/rip/rip.c2
-rw-r--r--proto/rip/rip.h2
4 files changed, 5 insertions, 5 deletions
diff --git a/bird.conf b/bird.conf
index b2ac49b..f024c16 100644
--- a/bird.conf
+++ b/bird.conf
@@ -33,7 +33,7 @@ protocol rip MyRIP_test {
passwords { password "ahoj" from 0 to 10;
password "nazdar" from 10;
}
- authentication plaintext;
+ authentication md5;
}
protocol device {
diff --git a/proto/rip/auth.c b/proto/rip/auth.c
index ccdcd56..17c8d3a 100644
--- a/proto/rip/auth.c
+++ b/proto/rip/auth.c
@@ -56,7 +56,7 @@ rip_incoming_authentication( struct proto *p, struct rip_block_auth *block, stru
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;
}
@@ -145,7 +145,7 @@ rip_outgoing_authentication( struct proto *p, struct rip_block_auth *block, stru
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" );
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 16c61cf..cca329e 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -352,7 +352,7 @@ rip_process_packet( struct proto *p, struct rip_packet *packet, int num, ip_addr
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;
diff --git a/proto/rip/rip.h b/proto/rip/rip.h
index 613d198..fb066b5 100644
--- a/proto/rip/rip.h
+++ b/proto/rip/rip.h
@@ -28,7 +28,7 @@ struct rip_connection {
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 */