From cb6adc643b2ebebe4f29b9958853a2e8190aec82 Mon Sep 17 00:00:00 2001 From: sg Date: Thu, 17 Sep 2015 22:20:12 +0200 Subject: [PATCH] PPP: more const fixes --- src/netif/ppp/chap-md5.c | 4 ++-- src/netif/ppp/chap_ms.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/netif/ppp/chap-md5.c b/src/netif/ppp/chap-md5.c index 4a2bb055..6e3a9d7c 100644 --- a/src/netif/ppp/chap-md5.c +++ b/src/netif/ppp/chap-md5.c @@ -80,8 +80,8 @@ static int chap_md5_verify_response(ppp_pcb *pcb, int id, const char *name, /* Generate hash of ID, secret, challenge */ md5_starts(&ctx); md5_update(&ctx, &idbyte, 1); - md5_update(&ctx, (unsigned char*)secret, secret_len); - md5_update(&ctx, (unsigned char*)challenge, challenge_len); + md5_update(&ctx, secret, secret_len); + md5_update(&ctx, challenge, challenge_len); md5_finish(&ctx, hash); /* Test if our hash matches the peer's response */ diff --git a/src/netif/ppp/chap_ms.c b/src/netif/ppp/chap_ms.c index d35db5ec..550c95d1 100644 --- a/src/netif/ppp/chap_ms.c +++ b/src/netif/ppp/chap_ms.c @@ -288,7 +288,7 @@ static int chapms_verify_response(ppp_pcb *pcb, int id, const char *name, #endif /* Generate the expected response. */ - ChapMS(pcb, (u_char *)challenge, (char *)secret, secret_len, md); + ChapMS(pcb, (const u_char *)challenge, (const char *)secret, secret_len, md); #ifdef MSLANMAN /* Determine which part of response to verify against */ @@ -327,8 +327,8 @@ static int chapms2_verify_response(ppp_pcb *pcb, int id, const char *name, goto bad; /* not even the right length */ /* Generate the expected response and our mutual auth. */ - ChapMS2(pcb, (u_char*)challenge, (u_char*)&response[MS_CHAP2_PEER_CHALLENGE], (char*)name, - (char *)secret, secret_len, md, + ChapMS2(pcb, (const u_char*)challenge, (const u_char*)&response[MS_CHAP2_PEER_CHALLENGE], name, + (const char *)secret, secret_len, md, (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR); /* compare MDs and send the appropriate status */