]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
md5 authentication seems to work.
authorPavel Machek <pavel@ucw.cz>
Thu, 25 Nov 1999 15:03:12 +0000 (15:03 +0000)
committerPavel Machek <pavel@ucw.cz>
Thu, 25 Nov 1999 15:03:12 +0000 (15:03 +0000)
bird.conf
proto/rip/auth.c
proto/rip/rip.c
proto/rip/rip.h

index b2ac49bf268800a1a5ed754c9c95f1bd3503049a..f024c1649663256096c8069e5c9861ef132aec12 100644 (file)
--- 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 {
index ccdcd56fb0eecb8a94fb3bd0e726d93b798adf33..17c8d3a66dafcd113b88e951818cf9720c7de973 100644 (file)
@@ -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" );
index 16c61cf51953a2019b6296408fdb666651aec39b..cca329ec4669e0e479f6afdf8933daa5f899412a 100644 (file)
@@ -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;
index 613d198c9445de0dd16328163c93a420bf566276..fb066b5d2c9e2987139c324d43cfddd04875a2db 100644 (file)
@@ -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 */