Linux Audio

Check our new training course

Loading...
v3.1
 
 1#ifndef _ISCSI_CHAP_H_
 2#define _ISCSI_CHAP_H_
 3
 
 
 
 4#define CHAP_DIGEST_MD5		5
 5#define CHAP_DIGEST_SHA		6
 
 
 6
 7#define CHAP_CHALLENGE_LENGTH	16
 8#define CHAP_CHALLENGE_STR_LEN	4096
 9#define MAX_RESPONSE_LENGTH	64	/* sufficient for MD5 */
10#define	MAX_CHAP_N_SIZE		512
11
12#define MD5_SIGNATURE_SIZE	16	/* 16 bytes in a MD5 message digest */
 
 
 
13
14#define CHAP_STAGE_CLIENT_A	1
15#define CHAP_STAGE_SERVER_AIC	2
16#define CHAP_STAGE_CLIENT_NR	3
17#define CHAP_STAGE_CLIENT_NRIC	4
18#define CHAP_STAGE_SERVER_NR	5
19
 
 
 
20extern u32 chap_main_loop(struct iscsi_conn *, struct iscsi_node_auth *, char *, char *,
21				int *, int *);
22
23struct iscsi_chap {
24	unsigned char	digest_type;
25	unsigned char	id;
26	unsigned char	challenge[CHAP_CHALLENGE_LENGTH];
 
 
 
27	unsigned int	authenticate_target;
28	unsigned int	chap_state;
29} ____cacheline_aligned;
30
31#endif   /*** _ISCSI_CHAP_H_ ***/
v5.9
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef _ISCSI_CHAP_H_
 3#define _ISCSI_CHAP_H_
 4
 5#include <linux/types.h>
 6
 7#define CHAP_DIGEST_UNKNOWN	0
 8#define CHAP_DIGEST_MD5		5
 9#define CHAP_DIGEST_SHA1	6
10#define CHAP_DIGEST_SHA256	7
11#define CHAP_DIGEST_SHA3_256	8
12
13#define MAX_CHAP_CHALLENGE_LEN	32
14#define CHAP_CHALLENGE_STR_LEN	4096
15#define MAX_RESPONSE_LENGTH	128	/* sufficient for SHA3 256 */
16#define	MAX_CHAP_N_SIZE		512
17
18#define MD5_SIGNATURE_SIZE	16	/* 16 bytes in a MD5 message digest */
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 */
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
29struct iscsi_node_auth;
30struct iscsi_conn;
31
32extern u32 chap_main_loop(struct iscsi_conn *, struct iscsi_node_auth *, char *, char *,
33				int *, int *);
34
35struct iscsi_chap {
 
36	unsigned char	id;
37	unsigned char	challenge[MAX_CHAP_CHALLENGE_LEN];
38	unsigned int	challenge_len;
39	unsigned char	*digest_name;
40	unsigned int	digest_size;
41	unsigned int	authenticate_target;
42	unsigned int	chap_state;
43} ____cacheline_aligned;
44
45#endif   /*** _ISCSI_CHAP_H_ ***/