X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fchap_ms.c;h=e3d808fd86ccb094cead86629234c3da6c54cdee;hb=dbd512d8a62489d67a32dbf6c4ec1428cb5df513;hp=d1e0cf80212c265cdfeae2c4c6659d15c8422108;hpb=5c9f2d0e37f7b761e7d966385028f32cb0cca0cf;p=ppp.git diff --git a/pppd/chap_ms.c b/pppd/chap_ms.c index d1e0cf8..e3d808f 100644 --- a/pppd/chap_ms.c +++ b/pppd/chap_ms.c @@ -654,11 +654,12 @@ ChapMS_LANMan(u_char *rchallenge, char *secret, int secret_len, BZERO(UcasePassword, sizeof(UcasePassword)); for (i = 0; i < secret_len; i++) UcasePassword[i] = (u_char)toupper(secret[i]); - (void) DesSetkey(UcasePassword + 0); - DesEncrypt( StdText, PasswordHash + 0 ); - (void) DesSetkey(UcasePassword + 7); - DesEncrypt( StdText, PasswordHash + 8 ); - ChallengeResponse(rchallenge, PasswordHash, &response[MS_CHAP_LANMANRESP]); + + if (DesEncrypt(StdText, UcasePassword + 0, PasswordHash + 0) && + DesEncrypt(StdText, UcasePassword + 7, PasswordHash + 8)) { + + ChallengeResponse(rchallenge, PasswordHash, &response[MS_CHAP_LANMANRESP]); + } } #endif @@ -686,7 +687,7 @@ GenerateAuthenticatorResponse(unsigned char* PasswordHashHash, int i; PPP_MD_CTX *ctx; - u_char Digest[SHA_DIGEST_LENGTH]; + u_char Digest[SHA_DIGEST_LENGTH] = {}; int hash_len; u_char Challenge[8];