Lines Matching refs:chap
57 struct iscsi_chap *chap = conn->auth_protocol; in chap_gen_challenge() local
61 get_random_bytes(chap->challenge, CHAP_CHALLENGE_LENGTH); in chap_gen_challenge()
62 chap_binaryhex_to_asciihex(challenge_asciihex, chap->challenge, in chap_gen_challenge()
117 struct iscsi_chap *chap; in chap_server_open() local
130 chap = conn->auth_protocol; in chap_server_open()
140 chap->digest_type = CHAP_DIGEST_MD5; in chap_server_open()
141 pr_debug("[server] Sending CHAP_A=%d\n", chap->digest_type); in chap_server_open()
152 chap->id = conn->tpg->tpg_chap_id++; in chap_server_open()
153 *aic_len += sprintf(aic_str + *aic_len, "CHAP_I=%d", chap->id); in chap_server_open()
155 pr_debug("[server] Sending CHAP_I=%d\n", chap->id); in chap_server_open()
161 return chap; in chap_server_open()
187 struct iscsi_chap *chap = conn->auth_protocol; in chap_server_compute_md5() local
263 sg_init_one(&sg, &chap->id, 1); in chap_server_compute_md5()
279 sg_init_one(&sg, chap->challenge, CHAP_CHALLENGE_LENGTH); in chap_server_compute_md5()
367 if (!memcmp(challenge_binhex, chap->challenge, CHAP_CHALLENGE_LENGTH)) { in chap_server_compute_md5()
455 struct iscsi_chap *chap = conn->auth_protocol; in chap_got_response() local
457 switch (chap->digest_type) { in chap_got_response()
465 chap->digest_type); in chap_got_response()
478 struct iscsi_chap *chap = conn->auth_protocol; in chap_main_loop() local
480 if (!chap) { in chap_main_loop()
481 chap = chap_server_open(conn, auth, in_text, out_text, out_len); in chap_main_loop()
482 if (!chap) in chap_main_loop()
484 chap->chap_state = CHAP_STAGE_SERVER_AIC; in chap_main_loop()
486 } else if (chap->chap_state == CHAP_STAGE_SERVER_AIC) { in chap_main_loop()
494 chap->chap_state = CHAP_STAGE_SERVER_NR; in chap_main_loop()