X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fchap-md5.c;h=77dd4ecc705984bad999cb51fb6b8889f5b82f48;hp=2529f4e54d34d40b571024295312e59615a7ede9;hb=c9d9dbfb8459b528ab56bd1cf0c41460801bbfdf;hpb=71d3de90eae52087b405e962ca650b71cec79c67 diff --git a/pppd/chap-md5.c b/pppd/chap-md5.c index 2529f4e..77dd4ec 100644 --- a/pppd/chap-md5.c +++ b/pppd/chap-md5.c @@ -10,16 +10,11 @@ * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The name(s) of the authors of this software must not be used to + * 2. The name(s) of the authors of this software must not be used to * endorse or promote products derived from this software without * prior written permission. * - * 4. Redistributions of any form whatsoever must retain the following + * 3. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by Paul Mackerras * ". @@ -33,7 +28,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id" +#define RCSID "$Id: chap-md5.c,v 1.4 2004/11/09 22:39:25 paulus Exp $" #include #include @@ -73,11 +68,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) { @@ -98,11 +93,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; }