summaryrefslogtreecommitdiffstats
path: root/isisd/isis_tlv.c
diff options
context:
space:
mode:
authorFritz Reichmann <fritz@reichmann.nl>2009-08-13 13:32:11 +0000
committerDavid Lamparter <equinox@diac24.net>2010-02-03 05:09:29 +0100
commitbca3bf7f714cc0c6f1a7983a2450df4d76a75207 (patch)
tree1b42eadb8b72803ac3b7371eae184835a4a0c91f /isisd/isis_tlv.c
parent386b1b80a728f6d02a4de665e8ac3b3163efc0b3 (diff)
downloadquagga-bca3bf7f714cc0c6f1a7983a2450df4d76a75207.tar.bz2
quagga-bca3bf7f714cc0c6f1a7983a2450df4d76a75207.tar.xz
isisd: md5 link authentication
Implement isis circuit md5 authentication * Replace command "isis passwd" with "isis passwd {clear|md5}" * Verify HMAC MD5 on ISIS Hello PDUs * Add HMAC MD5 authentication to md5.h/md5.c from RFC2104
Diffstat (limited to 'isisd/isis_tlv.c')
-rw-r--r--isisd/isis_tlv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/isisd/isis_tlv.c b/isisd/isis_tlv.c
index 9fffef51..3fc717e3 100644
--- a/isisd/isis_tlv.c
+++ b/isisd/isis_tlv.c
@@ -446,6 +446,10 @@ parse_tlvs (char *areatag, u_char * stream, int size, u_int32_t * expected,
tlvs->auth_info.len = length-1;
pnt++;
memcpy (tlvs->auth_info.passwd, pnt, length - 1);
+ /* Fill authentication with 0 for later computation
+ * of MD5 (RFC 5304, 2)
+ */
+ memset (pnt, 0, length - 1);
pnt += length - 1;
}
else
@@ -878,7 +882,7 @@ tlv_add_authinfo (char auth_type, char auth_len, u_char *auth_value,
{
u_char value[255];
u_char *pos = value;
- *pos++ = ISIS_PASSWD_TYPE_CLEARTXT;
+ *pos++ = auth_type;
memcpy (pos, auth_value, auth_len);
return add_tlv (AUTH_INFO, auth_len + 1, value, stream);