mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-11 22:02:23 +00:00
eigrpd: Fix a md5 digest issue
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
89bb508b99
commit
5da387853b
@ -161,6 +161,7 @@ int eigrp_check_md5_digest(struct stream *s,
|
|||||||
{
|
{
|
||||||
MD5_CTX ctx;
|
MD5_CTX ctx;
|
||||||
unsigned char digest[EIGRP_AUTH_TYPE_MD5_LEN];
|
unsigned char digest[EIGRP_AUTH_TYPE_MD5_LEN];
|
||||||
|
unsigned char orig[EIGRP_AUTH_TYPE_MD5_LEN];
|
||||||
struct key *key = NULL;
|
struct key *key = NULL;
|
||||||
struct keychain *keychain;
|
struct keychain *keychain;
|
||||||
u_char *ibuf;
|
u_char *ibuf;
|
||||||
@ -181,7 +182,9 @@ int eigrp_check_md5_digest(struct stream *s,
|
|||||||
|
|
||||||
auth_TLV = (struct TLV_MD5_Authentication_Type *)(s->data
|
auth_TLV = (struct TLV_MD5_Authentication_Type *)(s->data
|
||||||
+ EIGRP_HEADER_LEN);
|
+ EIGRP_HEADER_LEN);
|
||||||
memset(auth_TLV->digest, 0, sizeof(auth_TLV->digest));
|
memcpy(orig, auth_TLV->digest, EIGRP_AUTH_TYPE_MD5_LEN);
|
||||||
|
memset(digest, 0, EIGRP_AUTH_TYPE_MD5_LEN);
|
||||||
|
memset(auth_TLV->digest, 0, EIGRP_AUTH_TYPE_MD5_LEN);
|
||||||
|
|
||||||
ibuf = s->data;
|
ibuf = s->data;
|
||||||
backup_end = s->endp;
|
backup_end = s->endp;
|
||||||
@ -219,15 +222,14 @@ int eigrp_check_md5_digest(struct stream *s,
|
|||||||
MD5Final(digest, &ctx);
|
MD5Final(digest, &ctx);
|
||||||
|
|
||||||
/* compare the two */
|
/* compare the two */
|
||||||
if (memcmp(authTLV->digest, digest, EIGRP_AUTH_TYPE_MD5_LEN) == 0) {
|
if (memcmp(orig, digest, EIGRP_AUTH_TYPE_MD5_LEN) != 0) {
|
||||||
zlog_debug("VSETKO OK");
|
|
||||||
} else {
|
|
||||||
zlog_warn("interface %s: eigrp_check_md5 checksum mismatch",
|
zlog_warn("interface %s: eigrp_check_md5 checksum mismatch",
|
||||||
IF_NAME(nbr->ei));
|
IF_NAME(nbr->ei));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save neighbor's crypt_seqnum */
|
/* save neighbor's crypt_seqnum */
|
||||||
|
if (nbr)
|
||||||
nbr->crypt_seqnum = authTLV->key_sequence;
|
nbr->crypt_seqnum = authTLV->key_sequence;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user