⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 secret.h.qin

📁 界面程序
💻 QIN
字号:
# ifndef	SECRET_H
# define	SECRET_H

# define	MAX_PINERR_TIMES	4
#ifdef bianzg_mod_20011121

# define	MSGHD_LEN	8	

#else

#define 	MSGHD_LEN	7

#endif

//# define	PIN_LEN		6
# define	EPIN_LEN	7
# define	PINBLK_LEN	16
# define	HSM_ERRCD_LEN	2
# define	HSM_CMD_LEN	2
# define	SKEY_LEN	16
# define	DKEY_LEN	32
# define	CHKVALUE_LEN	16
# define	MAC_LEN		8
# define	MAB_LEN		16

# define	HSMCMDQUE_KEY	0x7101
# define	HSMREPQUE_KEY	0x7102
# define        HSMCMDQUE_KEY2  0x7201
# define        HSMREPQUE_KEY2  0x7202

# define	HSMH_LEN	(3*sizeof(long)+2*sizeof(short))
# define	HSMMSG_LEN	2048

typedef	struct	hsmque  {
	long	mesg_type;
	short	mesg_len;
	long	rtn_seq;
	long	req_time;
	short	action;
	char	data[HSMMSG_LEN];
}  HsmMesg;

typedef struct _pinblock  {
	char	key[SKEY_LEN+1];
	char	key_idx;
	short	len;
	char	format[3];
	char	block[PINBLK_LEN+1];
	char	card_no[21];
}  PINBLOCK;

# define	SNDMSG_ERR	-1
# define	RCVMSG_ERR	-2
# define	HSM_TIMEOUT	-3

# define	CHKRTNSEQ	1
# define	NOCHKRTNSEQ	2

/*  Generating a TPK for working between cardpool and EDC, input posno, output
    TPK encryption under TMK between EDC and cardpool. if success, return 0,
    otherwise return none-zero 
    Input: posno (8-char string)
    Output: TPK (16-hex string)
*/
extern  int  get_pos_tpk(char *posno, char *TPK, int flag);

/*  Translate a PIN block(ANSI 9.8X) encryption under ZPK for working between
    Cardpool and GoldCard-Host to another PIN block encryption under ZPK for 
    working between Cardpool and Host.
    Input:  card_no, pindata1(16-hex string),
    Output: pindata2(16-hex string);
    Return: 0 for doing sucessfully, otherwise none-zero.
*/
extern  int  trgoldpintohost(char *card_no, char *pindata1, char *pindata2);

/*  Translate a PIN block(ANSI 9.8X) encryption under TPK for working between
    Cardpool and EDC to another PIN block encryption under ZPK for working 
    between Cardpool and Host.
    Input:  card_no, posno(8-char string), pindata1(16-hex string),
    Output: pindata2(16-hex string);
    Return: 0 for doing sucessfully, otherwise none-zero.
*/
extern  int  trpospintohost(char *card_no, char *posno, char *pindata1, char *pindata2);

/*  Translate a PIN block(ANSI 9.8X) encryption under TPK for working between
    Cardpool and EDC to another PIN block encryption under ZPK for working 
    between Cardpool and GoldCard-Host.
    Input:  card_no, posno(8-char string), pindata1(16-hex string),
    Output: pindata2(16-hex string);
    Return: 0 for doing sucessfully, otherwise none-zero.
*/
extern  int  trpospintogold(char *card_no, char *posno, char *pindata1, char *pindata2);

/*  Translate a ZPK from encryption under ZMK between Host and Cardpool into
    encryption under LMK, and save it into database.
    Input:  ZPK: 16-hex string, the PIN working key encrpted under ZMK 
    Return: 0 for doing sucessfully, otherwise none-zero.
*/
extern  int  put_host_zpk(char *ZPK_zmk, int flag);

# endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -