summaryrefslogtreecommitdiffstats
path: root/src/openvpn/push.c
diff options
context:
space:
mode:
authorSteffan Karger <steffan@karger.me>2015-05-03 17:07:11 +0200
committerGert Doering <gert@greenie.muc.de>2015-05-23 14:17:59 +0200
commit827de237860813d2859aaae3aca292d42a9c2a82 (patch)
tree13b527c877f4f62c5c4d51ac0d29243082ea69ca /src/openvpn/push.c
parentdb950be85d37eab40d8fffe0bc2060059f8a7e10 (diff)
downloadopenvpn-827de237860813d2859aaae3aca292d42a9c2a82.tar.gz
openvpn-827de237860813d2859aaae3aca292d42a9c2a82.tar.xz
openvpn-827de237860813d2859aaae3aca292d42a9c2a82.zip
cleanup: remove md5 helper functions
The MD5 wrapper functions were used in just a few places, which imho is not worth the extra code. Instead of using these wrappers, just use the generic md_ctx_*() functions directly. The md5sum() function was only used for logging information that was not useful to a user; first the full options string would be printed, and later just the hash. That hash is less informative than the full string, so why print it at all? Finally, also removed save_pulled_options_digest(). The two times it was called, it executed either one of the possible branches in the function, where one of these needed a comment to explain what passing NULL as newdigest is supposed to do... Signed-off-by: Steffan Karger <steffan@karger.me> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <1430665631-4022-1-git-send-email-steffan@karger.me> URL: http://article.gmane.org/gmane.network.openvpn.devel/9642 Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/push.c')
-rw-r--r--src/openvpn/push.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/openvpn/push.c b/src/openvpn/push.c
index 932df5c..c99a097 100644
--- a/src/openvpn/push.c
+++ b/src/openvpn/push.c
@@ -465,7 +465,7 @@ process_incoming_push_msg (struct context *c,
struct buffer buf_orig = buf;
if (!c->c2.pulled_options_md5_init_done)
{
- md5_state_init (&c->c2.pulled_options_state);
+ md_ctx_init(&c->c2.pulled_options_state, md_kt_get("MD5"));
c->c2.pulled_options_md5_init_done = true;
}
if (!c->c2.did_pre_pull_restore)
@@ -482,13 +482,14 @@ process_incoming_push_msg (struct context *c,
{
case 0:
case 1:
- md5_state_update (&c->c2.pulled_options_state, BPTR(&buf_orig), BLEN(&buf_orig));
- md5_state_final (&c->c2.pulled_options_state, &c->c2.pulled_options_digest);
+ md_ctx_update (&c->c2.pulled_options_state, BPTR(&buf_orig), BLEN(&buf_orig));
+ md_ctx_final (&c->c2.pulled_options_state, c->c2.pulled_options_digest);
+ md_ctx_cleanup (&c->c2.pulled_options_state);
c->c2.pulled_options_md5_init_done = false;
ret = PUSH_MSG_REPLY;
break;
case 2:
- md5_state_update (&c->c2.pulled_options_state, BPTR(&buf_orig), BLEN(&buf_orig));
+ md_ctx_update (&c->c2.pulled_options_state, BPTR(&buf_orig), BLEN(&buf_orig));
ret = PUSH_MSG_CONTINUATION;
break;
}