Lines Matching defs:rchap
344 struct rchap *
347 struct rchap *rchap;
349 rchap = calloc(sizeof(*rchap), 1);
350 if (rchap == NULL)
353 rchap->rchap_secret = checked_strdup(secret);
355 return (rchap);
359 rchap_receive_bin(struct rchap *rchap, const unsigned char id,
363 rchap->rchap_id = id;
364 rchap->rchap_challenge = calloc(challenge_len, 1);
365 if (rchap->rchap_challenge == NULL)
367 memcpy(rchap->rchap_challenge, challenge, challenge_len);
368 rchap->rchap_challenge_len = challenge_len;
372 rchap_receive(struct rchap *rchap, const char *id, const char *challenge)
389 rchap_receive_bin(rchap, id_bin, challenge_bin, challenge_bin_len);
396 rchap_get_response_bin(struct rchap *rchap,
406 chap_compute_md5(rchap->rchap_id, rchap->rchap_secret,
407 rchap->rchap_challenge, rchap->rchap_challenge_len,
415 rchap_get_response(struct rchap *rchap)
421 rchap_get_response_bin(rchap, &response, &response_len);
429 rchap_delete(struct rchap *rchap)
432 free(rchap->rchap_secret);
433 free(rchap->rchap_challenge);
434 free(rchap);