Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ISCSI_CHAP_H_
0003 #define _ISCSI_CHAP_H_
0004 
0005 #include <linux/types.h>
0006 
0007 #define CHAP_DIGEST_UNKNOWN 0
0008 #define CHAP_DIGEST_MD5     5
0009 #define CHAP_DIGEST_SHA1    6
0010 #define CHAP_DIGEST_SHA256  7
0011 #define CHAP_DIGEST_SHA3_256    8
0012 
0013 #define MAX_CHAP_CHALLENGE_LEN  32
0014 #define CHAP_CHALLENGE_STR_LEN  4096
0015 #define MAX_RESPONSE_LENGTH 128 /* sufficient for SHA3 256 */
0016 #define MAX_CHAP_N_SIZE     512
0017 
0018 #define MD5_SIGNATURE_SIZE  16  /* 16 bytes in a MD5 message digest */
0019 #define SHA1_SIGNATURE_SIZE 20  /* 20 bytes in a SHA1 message digest */
0020 #define SHA256_SIGNATURE_SIZE   32  /* 32 bytes in a SHA256 message digest */
0021 #define SHA3_256_SIGNATURE_SIZE 32  /* 32 bytes in a SHA3 256 message digest */
0022 
0023 #define CHAP_STAGE_CLIENT_A 1
0024 #define CHAP_STAGE_SERVER_AIC   2
0025 #define CHAP_STAGE_CLIENT_NR    3
0026 #define CHAP_STAGE_CLIENT_NRIC  4
0027 #define CHAP_STAGE_SERVER_NR    5
0028 
0029 struct iscsi_node_auth;
0030 struct iscsit_conn;
0031 
0032 extern u32 chap_main_loop(struct iscsit_conn *, struct iscsi_node_auth *, char *, char *,
0033                 int *, int *);
0034 
0035 struct iscsi_chap {
0036     unsigned char   id;
0037     unsigned char   challenge[MAX_CHAP_CHALLENGE_LEN];
0038     unsigned int    challenge_len;
0039     unsigned char   *digest_name;
0040     unsigned int    digest_size;
0041     unsigned int    authenticate_target;
0042     unsigned int    chap_state;
0043 } ____cacheline_aligned;
0044 
0045 #endif   /*** _ISCSI_CHAP_H_ ***/