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;
258 struct iscsi_chap *chap = conn->auth_protocol;
263 digest = kzalloc(chap->digest_size, GFP_KERNEL);
269 response = kzalloc(chap->digest_size * 2 + 2, GFP_KERNEL);
275 client_digest = kzalloc(chap->digest_size, GFP_KERNEL);
281 server_digest = kzalloc(chap->digest_size, GFP_KERNEL);
333 if (strlen(chap_r) != chap->digest_size * 2) {
337 if (hex2bin(client_digest, chap_r, chap->digest_size) < 0) {
344 chap->digest_size) {
356 tfm = crypto_alloc_shash(chap->digest_name, 0, 0);
377 ret = crypto_shash_update(desc, &chap->id, 1);
390 ret = crypto_shash_finup(desc, chap->challenge,
391 chap->challenge_len, server_digest);
397 bin2hex(response, server_digest, chap->digest_size);
399 chap->digest_name, response);
401 if (memcmp(server_digest, client_digest, chap->digest_size) != 0) {
403 chap->digest_name);
407 " successful.\n\n", chap->digest_name);
440 pr_err("chap identifier: %lu greater than 255\n", id);
502 if (initiatorchg_len == chap->challenge_len &&
503 !memcmp(initiatorchg_binhex, chap->challenge,
552 bin2hex(response, digest, chap->digest_size);
579 struct iscsi_chap *chap = conn->auth_protocol;
581 if (!chap) {
582 chap = chap_server_open(conn, auth, in_text, out_text, out_len);
583 if (!chap)
585 chap->chap_state = CHAP_STAGE_SERVER_AIC;
587 } else if (chap->chap_state == CHAP_STAGE_SERVER_AIC) {
595 chap->chap_state = CHAP_STAGE_SERVER_NR;