- ctx = PPP_CIPHER_CTX_new();
- if (ctx != NULL) {
-
- if (PPP_CipherInit(ctx, PPP_des_ecb(), ZPasswordHash + 0, NULL, 1)) {
-
- if (PPP_CipherUpdate(ctx, response + offset, &outlen, challenge, 8)) {
- offset += outlen;
-
- PPP_CIPHER_CTX_set_cipher_data(ctx, ZPasswordHash + 7);
- if (PPP_CipherUpdate(ctx, response + offset, &outlen, challenge, 8)) {
- offset += outlen;
-
- PPP_CIPHER_CTX_set_cipher_data(ctx, ZPasswordHash + 14);
- if (PPP_CipherUpdate(ctx, response + offset, &outlen, challenge, 8)) {
- offset += outlen;
-
- if (PPP_CipherFinal(ctx, response + offset, &outlen)) {
-
- retval = 1;
- }
- }
- }
- }
- }
-
- PPP_CIPHER_CTX_free(ctx);
- }
+ if (DesEncrypt(challenge, ZPasswordHash + 0, response + 0) &&
+ DesEncrypt(challenge, ZPasswordHash + 7, response + 8) &&
+ DesEncrypt(challenge, ZPasswordHash + 14, response + 16))
+ return 1;