Lines Matching defs:chap
45 struct iscsi_chap *chap = conn->auth_protocol;
47 challenge_asciihex = kzalloc(chap->challenge_len * 2 + 1, GFP_KERNEL);
51 memset(chap->challenge, 0, MAX_CHAP_CHALLENGE_LEN);
53 ret = get_random_bytes_wait(chap->challenge, chap->challenge_len);
57 bin2hex(challenge_asciihex, chap->challenge,
58 chap->challenge_len);
145 struct iscsi_chap *chap;
158 chap = conn->auth_protocol;
162 chap->digest_size = MD5_SIGNATURE_SIZE;
165 chap->digest_size = SHA1_SIGNATURE_SIZE;
168 chap->digest_size = SHA256_SIGNATURE_SIZE;
171 chap->digest_size = SHA3_256_SIGNATURE_SIZE;
180 chap->digest_name = chap_get_digest_name(digest_type);
183 chap->challenge_len = chap->digest_size;
193 chap->id = conn->tpg->tpg_chap_id++;
194 *aic_len += sprintf(aic_str + *aic_len, "CHAP_I=%d", chap->id);
196 pr_debug("[server] Sending CHAP_I=%d\n", chap->id);
205 return chap;
226 struct iscsi_chap *chap = conn->auth_protocol;
231 digest = kzalloc(chap->digest_size, GFP_KERNEL);
237 response = kzalloc(chap->digest_size * 2 + 2, GFP_KERNEL);
243 client_digest = kzalloc(chap->digest_size, GFP_KERNEL);
249 server_digest = kzalloc(chap->digest_size, GFP_KERNEL);
302 if (strlen(chap_r) != chap->digest_size * 2) {
306 if (hex2bin(client_digest, chap_r, chap->digest_size) < 0) {
313 tfm = crypto_alloc_shash(chap->digest_name, 0, 0);
334 ret = crypto_shash_update(desc, &chap->id, 1);
347 ret = crypto_shash_finup(desc, chap->challenge,
348 chap->challenge_len, server_digest);
354 bin2hex(response, server_digest, chap->digest_size);
356 chap->digest_name, response);
358 if (memcmp(server_digest, client_digest, chap->digest_size) != 0) {
360 chap->digest_name);
364 " successful.\n\n", chap->digest_name);
391 pr_err("chap identifier: %lu greater than 255\n", id);
430 if (initiatorchg_len == chap->challenge_len &&
431 !memcmp(initiatorchg_binhex, chap->challenge,
480 bin2hex(response, digest, chap->digest_size);
507 struct iscsi_chap *chap = conn->auth_protocol;
509 if (!chap) {
510 chap = chap_server_open(conn, auth, in_text, out_text, out_len);
511 if (!chap)
513 chap->chap_state = CHAP_STAGE_SERVER_AIC;
515 } else if (chap->chap_state == CHAP_STAGE_SERVER_AIC) {
523 chap->chap_state = CHAP_STAGE_SERVER_NR;