X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fchap-md5.c;h=000f880e89e3d0859698b018689437acb120023e;hb=81a4d35394096e4e9bd7b9b189e91190e58b02a7;hp=b1f6ca04ffce871b50ed9296efec6fb87ebb2198;hpb=7977da267649fee17261d0d163a12863f3534b57;p=ppp.git diff --git a/pppd/chap-md5.c b/pppd/chap-md5.c index b1f6ca0..000f880 100644 --- a/pppd/chap-md5.c +++ b/pppd/chap-md5.c @@ -28,7 +28,11 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: chap-md5.c,v 1.3 2004/11/04 10:02:26 paulus Exp $" +#define RCSID "$Id: chap-md5.c,v 1.4 2004/11/09 22:39:25 paulus Exp $" + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include @@ -68,11 +72,11 @@ chap_md5_verify_response(int id, char *name, response_len = *response++; if (response_len == MD5_HASH_SIZE) { /* Generate hash of ID, secret, challenge */ - MD5Init(&ctx); - MD5Update(&ctx, &idbyte, 1); - MD5Update(&ctx, secret, secret_len); - MD5Update(&ctx, challenge, challenge_len); - MD5Final(hash, &ctx); + MD5_Init(&ctx); + MD5_Update(&ctx, &idbyte, 1); + MD5_Update(&ctx, secret, secret_len); + MD5_Update(&ctx, challenge, challenge_len); + MD5_Final(hash, &ctx); /* Test if our hash matches the peer's response */ if (memcmp(hash, response, MD5_HASH_SIZE) == 0) { @@ -93,11 +97,11 @@ chap_md5_make_response(unsigned char *response, int id, char *our_name, unsigned char idbyte = id; int challenge_len = *challenge++; - MD5Init(&ctx); - MD5Update(&ctx, &idbyte, 1); - MD5Update(&ctx, secret, secret_len); - MD5Update(&ctx, challenge, challenge_len); - MD5Final(&response[1], &ctx); + MD5_Init(&ctx); + MD5_Update(&ctx, &idbyte, 1); + MD5_Update(&ctx, (u_char *)secret, secret_len); + MD5_Update(&ctx, challenge, challenge_len); + MD5_Final(&response[1], &ctx); response[0] = MD5_HASH_SIZE; }