Lines Matching refs:chap
37 struct iscsi_chap *chap = conn->auth_protocol; in chap_gen_challenge() local
41 ret = get_random_bytes_wait(chap->challenge, CHAP_CHALLENGE_LENGTH); in chap_gen_challenge()
44 bin2hex(challenge_asciihex, chap->challenge, in chap_gen_challenge()
100 struct iscsi_chap *chap; in chap_server_open() local
113 chap = conn->auth_protocol; in chap_server_open()
123 chap->digest_type = CHAP_DIGEST_MD5; in chap_server_open()
124 pr_debug("[server] Sending CHAP_A=%d\n", chap->digest_type); in chap_server_open()
136 chap->id = conn->tpg->tpg_chap_id++; in chap_server_open()
137 *aic_len += sprintf(aic_str + *aic_len, "CHAP_I=%d", chap->id); in chap_server_open()
139 pr_debug("[server] Sending CHAP_I=%d\n", chap->id); in chap_server_open()
148 return chap; in chap_server_open()
174 struct iscsi_chap *chap = conn->auth_protocol; in chap_server_compute_md5() local
263 ret = crypto_shash_update(desc, &chap->id, 1); in chap_server_compute_md5()
276 ret = crypto_shash_finup(desc, chap->challenge, in chap_server_compute_md5()
357 if (!memcmp(challenge_binhex, chap->challenge, CHAP_CHALLENGE_LENGTH)) { in chap_server_compute_md5()
427 struct iscsi_chap *chap = conn->auth_protocol; in chap_got_response() local
429 switch (chap->digest_type) { in chap_got_response()
437 chap->digest_type); in chap_got_response()
450 struct iscsi_chap *chap = conn->auth_protocol; in chap_main_loop() local
452 if (!chap) { in chap_main_loop()
453 chap = chap_server_open(conn, auth, in_text, out_text, out_len); in chap_main_loop()
454 if (!chap) in chap_main_loop()
456 chap->chap_state = CHAP_STAGE_SERVER_AIC; in chap_main_loop()
458 } else if (chap->chap_state == CHAP_STAGE_SERVER_AIC) { in chap_main_loop()
466 chap->chap_state = CHAP_STAGE_SERVER_NR; in chap_main_loop()