summaryrefslogtreecommitdiff
path: root/proto/rip
diff options
context:
space:
mode:
authorPavel TvrdĂ­k <pawel.tvrdik@gmail.com>2015-11-13 16:08:28 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2015-11-24 16:01:48 +0100
commit33b4f40acce02c90b4b7766c5c94ebf2d22765c6 (patch)
treeccaab628e4e9831f1bf1e7374937b548f56e51db /proto/rip
parent90f78507f4a13673ccf0ba7c786b43d9e882fca7 (diff)
MD5: Mormalize naming style
Diffstat (limited to 'proto/rip')
-rw-r--r--proto/rip/packets.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/proto/rip/packets.c b/proto/rip/packets.c
index be20734f..9f10fd67 100644
--- a/proto/rip/packets.c
+++ b/proto/rip/packets.c
@@ -241,10 +241,10 @@ rip_fill_authentication(struct rip_proto *p, struct rip_iface *ifa, struct rip_p
*plen += sizeof(struct rip_auth_tail) + RIP_MD5_LENGTH;
- struct MD5Context ctxt;
- MD5Init(&ctxt);
- MD5Update(&ctxt, (byte *) pkt, *plen);
- MD5Final(tail->auth_data, &ctxt);
+ struct md5_context ctx;
+ md5_init(&ctx);
+ md5_update(&ctx, (byte *) pkt, *plen);
+ memcpy(tail->auth_data, md5_final(&ctx), RIP_MD5_LENGTH);
return;
default:
@@ -312,15 +312,13 @@ rip_check_authentication(struct rip_proto *p, struct rip_iface *ifa, struct rip_
}
char received[RIP_MD5_LENGTH];
- char computed[RIP_MD5_LENGTH];
-
memcpy(received, tail->auth_data, RIP_MD5_LENGTH);
strncpy(tail->auth_data, pass->password, RIP_MD5_LENGTH);
- struct MD5Context ctxt;
- MD5Init(&ctxt);
- MD5Update(&ctxt, (byte *) pkt, *plen);
- MD5Final(computed, &ctxt);
+ struct md5_context ctx;
+ md5_init(&ctx);
+ md5_update(&ctx, (byte *) pkt, *plen);
+ char *computed = md5_final(&ctx);
if (memcmp(received, computed, RIP_MD5_LENGTH))
DROP("wrong MD5 digest", pass->id);