brintos

brintos / linux-shallow public Read only

0
0
Text · 1.3 KiB · ceb9b77 Raw
46 lines · c
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	08#define CHAP_DIGEST_MD5		59#define CHAP_DIGEST_SHA1	610#define CHAP_DIGEST_SHA256	711#define CHAP_DIGEST_SHA3_256	812 13#define MAX_CHAP_CHALLENGE_LEN	3214#define CHAP_CHALLENGE_STR_LEN	409615#define MAX_RESPONSE_LENGTH	128	/* sufficient for SHA3 256 */16#define	MAX_CHAP_N_SIZE		51217 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	124#define CHAP_STAGE_SERVER_AIC	225#define CHAP_STAGE_CLIENT_NR	326#define CHAP_STAGE_CLIENT_NRIC	427#define CHAP_STAGE_SERVER_NR	528 29struct iscsi_node_auth;30struct iscsit_conn;31 32extern u32 chap_main_loop(struct iscsit_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_ ***/46