]> Git Repo - linux.git/blame - drivers/target/iscsi/iscsi_target_auth.h
Linux 6.14-rc3
[linux.git] / drivers / target / iscsi / iscsi_target_auth.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
e48354ce
NB
2#ifndef _ISCSI_CHAP_H_
3#define _ISCSI_CHAP_H_
4
8dcf07be
BVA
5#include <linux/types.h>
6
3160723c 7#define CHAP_DIGEST_UNKNOWN 0
e48354ce 8#define CHAP_DIGEST_MD5 5
a572d24a
ML
9#define CHAP_DIGEST_SHA1 6
10#define CHAP_DIGEST_SHA256 7
11#define CHAP_DIGEST_SHA3_256 8
e48354ce 12
19f5f88e 13#define MAX_CHAP_CHALLENGE_LEN 32
e48354ce 14#define CHAP_CHALLENGE_STR_LEN 4096
a572d24a 15#define MAX_RESPONSE_LENGTH 128 /* sufficient for SHA3 256 */
e48354ce
NB
16#define MAX_CHAP_N_SIZE 512
17
18#define MD5_SIGNATURE_SIZE 16 /* 16 bytes in a MD5 message digest */
a572d24a
ML
19#define SHA1_SIGNATURE_SIZE 20 /* 20 bytes in a SHA1 message digest */
20#define SHA256_SIGNATURE_SIZE 32 /* 32 bytes in a SHA256 message digest */
21#define SHA3_256_SIGNATURE_SIZE 32 /* 32 bytes in a SHA3 256 message digest */
e48354ce
NB
22
23#define CHAP_STAGE_CLIENT_A 1
24#define CHAP_STAGE_SERVER_AIC 2
25#define CHAP_STAGE_CLIENT_NR 3
26#define CHAP_STAGE_CLIENT_NRIC 4
27#define CHAP_STAGE_SERVER_NR 5
28
8dcf07be 29struct iscsi_node_auth;
be36d683 30struct iscsit_conn;
8dcf07be 31
be36d683 32extern u32 chap_main_loop(struct iscsit_conn *, struct iscsi_node_auth *, char *, char *,
e48354ce
NB
33 int *, int *);
34
35struct iscsi_chap {
e48354ce 36 unsigned char id;
19f5f88e 37 unsigned char challenge[MAX_CHAP_CHALLENGE_LEN];
a572d24a
ML
38 unsigned int challenge_len;
39 unsigned char *digest_name;
40 unsigned int digest_size;
e48354ce
NB
41 unsigned int authenticate_target;
42 unsigned int chap_state;
43} ____cacheline_aligned;
44
45#endif /*** _ISCSI_CHAP_H_ ***/
This page took 0.90859 seconds and 4 git commands to generate.