Lines Matching defs:cstate
23 show_response(chap_state *cstate, const char *str)
27 printf("%s -- %d bytes:", str, cstate->resp_length);
29 for (i = 0; i < cstate->resp_length; i++) {
32 printf("%02X ", (unsigned int)cstate->response[i]);
44 chap_state cstate;
60 BZERO(&cstate, sizeof(cstate));
61 ChapMS(&cstate, challenge, sizeof(challenge), argv[2], strlen(argv[2]));
63 show_response(&cstate, "MS-CHAPv1 with LAN Manager");
65 show_response(&cstate, "MS-CHAPv1");
68 cstate.chal_len = sizeof(challenge);
69 BCOPY(challenge, cstate.challenge, cstate.chal_len);
70 if (!ChapMSValidate(&cstate, cstate.response, cstate.resp_length,
75 cstate.response[MS_CHAP_RESPONSE_LEN-1] = '\0';
76 if (!ChapMSValidate(&cstate, cstate.response, cstate.resp_length,
82 cstate.resp_name = "joe user";
83 ChapMSv2(&cstate, cstate.challenge, 16, argv[2], strlen(argv[2]));
84 show_response(&cstate, "MS-CHAPv2");
85 if (!ChapMSv2Validate(&cstate, cstate.resp_name, cstate.response,
86 cstate.resp_length, argv[2], strlen(argv[2])))