]> git.proxmox.com Git - mirror_frr.git/commit - ospfd/ospf_packet.c
ospfd: bring ospf_check_auth() into focus
authorDenis Ovsienko <infrastation@yandex.ru>
Sun, 26 Feb 2012 13:59:43 +0000 (17:59 +0400)
committerDavid Lamparter <equinox@diac24.net>
Mon, 12 Mar 2012 10:05:38 +0000 (11:05 +0100)
commitbd5651f0ec7aa94627a2a6868dd458f016750a35
tree9f5dcd01bd90d1ea78cd841f00fea4bbdc3a6dee
parentef1b78cbcd8ade0c5444f3ff9dd00a40e760ec92
ospfd: bring ospf_check_auth() into focus

The old ospf_check_auth() function did two different jobs depending on
AuType. For Null and Simple cases it actually authenticated the packet,
but for Cryptographic case it only checked declared packet size (not
taking the actual number of bytes on wire into account). The calling
function, ospf_verify_header(), had its own set of MD5/checksum checks
dispatched depending on AuType.

This commit makes the packet size check work against the real number of
bytes and moves it to ospf_packet_examine(). All MD5/checksum
verification is now performed in ospf_check_auth() function.

* ospf_packet.c
  * ospf_packet_examin(): check length with MD5 bytes in mind
  * ospf_verify_header(): remove all AuType-specific code
  * ospf_check_auth(): completely rewrite
ospfd/ospf_packet.c