Lines Matching defs:response
34 * Implemented LANManager type password response to MS-CHAP challenges.
106 #define MS_AUTH_RESPONSE_LENGTH 40 /* MS-CHAPv2 authenticator response, */
118 * Offsets within the response field for MS-CHAP
127 * Offsets within the response field for MS-CHAP2
251 const unsigned char *challenge, const unsigned char *response,
260 response_len = *response++;
265 if (!response[MS_CHAP_USENT]) {
272 /* Generate the expected response. */
276 /* Determine which part of response to verify against */
277 if (!response[MS_CHAP_USENT])
278 diff = memcmp(&response[MS_CHAP_LANMANRESP],
282 diff = memcmp(&response[MS_CHAP_NTRESP], &md[MS_CHAP_NTRESP],
299 const unsigned char *challenge, const unsigned char *response,
307 response_len = *response++;
311 /* Generate the expected response and our mutual auth. */
312 ChapMS2(pcb, (const u_char*)challenge, (const u_char*)&response[MS_CHAP2_PEER_CHALLENGE], name,
336 if (memcmp(&md[MS_CHAP2_NTRESP], &response[MS_CHAP2_NTRESP],
338 if (response[MS_CHAP2_FLAGS])
353 * c = challenge to use for next response, we reuse previous
362 * actually accept another response based on the error message
363 * (and no clients try to resend a response anyway).
374 static void chapms_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name,
381 *response++ = MS_CHAP_RESPONSE_LEN;
382 ChapMS(pcb, challenge, secret, secret_len, response);
385 static void chapms2_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name,
390 *response++ = MS_CHAP2_RESPONSE_LEN;
397 our_name, secret, secret_len, response, private_,
498 u_char response[24]) {
514 lwip_des_crypt_ecb(&des, challenge, response +0);
520 lwip_des_crypt_ecb(&des, challenge, response +8);
526 lwip_des_crypt_ecb(&des, challenge, response +16);
530 dbglog("ChallengeResponse - response %.24B", response);
613 unsigned char *response) {
637 ChallengeResponse(rchallenge, PasswordHash, &response[MS_CHAP_LANMANRESP]);
647 * "Magic" constants used in response generation, from RFC 2759.
839 unsigned char *response) {
843 BZERO(response, MS_CHAP_RESPONSE_LEN);
845 ChapMS_NT(rchallenge, secret, secret_len, &response[MS_CHAP_NTRESP]);
849 &response[MS_CHAP_LANMANRESP]);
852 response[MS_CHAP_USENT] = !ms_lanman;
854 response[MS_CHAP_USENT] = 1;
865 * field of response is filled in. Call this way when generating a response.
867 * Call this way when verifying a response (or debugging).
868 * Do not call with PeerChallenge = response.
870 * The PeerChallenge field of response is then used for calculation of the
874 const char *user, const char *secret, int secret_len, unsigned char *response,
882 BZERO(response, MS_CHAP2_RESPONSE_LEN);
886 magic_random_bytes(&response[MS_CHAP2_PEER_CHALLENGE], MS_CHAP2_PEER_CHAL_LEN);
888 MEMCPY(&response[MS_CHAP2_PEER_CHALLENGE], PeerChallenge,
892 ChapMS2_NT(rchallenge, &response[MS_CHAP2_PEER_CHALLENGE], user,
893 secret, secret_len, &response[MS_CHAP2_NTRESP]);
897 &response[MS_CHAP2_NTRESP],
898 &response[MS_CHAP2_PEER_CHALLENGE],
903 &response[MS_CHAP2_NTRESP], authenticator);