📄 stasc.c
字号:
if (cr_header(SC_CLOSE, sec_mess)) return (-1); /* set parameters */ SCCLOSE.filecat = file_cat; SCCLOSE.context = file_close_context; SCCLOSE.file_sel = file_sel; /* call create_trans */ if (create_trans(sct_id, TRUE)) return (-1); /*----------------------------------------------*/ /* normal end => release response storage */ /*----------------------------------------------*/ sta_aux_bytestr_free(&response);#ifdef TEST fprintf(stdout, "\n***** Normal end of sca_close_file *****\n\n");#endif return (0);}/*-------------------------------------------------------------*//* E N D O F P R O C E D U R E sca_close_file *//*-------------------------------------------------------------*//*-------------------------------------------------------------*//* | GMD *//* +-----*//* PROC sca_lock_file VERSION 1.0 *//* DATE Januar 1992 *//* BY Levona Eckstein *//* *//* DESCRIPTION *//* Lock working elementary file on the smartcard. *//* *//* *//* IN DESCRIPTION *//* sct_id SCT identifier *//* *//* file_id File identifier *//* *//* sec_mess security modes *//* *//* OUT *//* *//* *//* RETURN DESCRIPTION *//* 0 o.k *//* -1 error *//* *//* CALLED FUNCTIONS *//* check_sct_sc ERROR-Codes *//* ENOCARD *//* ESIDUNK *//* ENOSHELL *//* EOPERR *//* EEMPTY *//* EMEMAVAIL *//* ECLERR *//* ERDERR *//* EINVARG *//* ETOOLONG *//* sw1/sw2 from SCT response *//* T1 - ERROR *//* *//* cr_header ERROR-Codes *//* M_ESECMESS *//* *//* *//* create_trans ERROR-Codes *//* EINVARG *//* ETOOLONG *//* EMEMAVAIL *//* ESIDUNK *//* EPARMISSED *//* EPARINC *//* INVPAR *//* EINVINS *//* sw1/sw2 from SCT response *//* T1 - ERROR *//* sw1/sw2 from SC response *//* *//*-------------------------------------------------------------*/intsca_lock_file(sct_id, file_id, sec_mess) int sct_id; FileId *file_id; SecMess *sec_mess;{ /*----------------------------------------------------------*/ /* Definitions */ /*----------------------------------------------------------*/ /*----------------------------------------------------------*/ /* Statements */ /*----------------------------------------------------------*/#ifdef TEST fprintf(stdout, "\n***** STAMOD-Routine sca_lock_file *****\n\n"); fprintf(stdout, "TRACE of the input parameters : \n"); fprintf(stdout, "sct_id : %d\n", sct_id); print_fileid(file_id); print_secmess(sec_mess);#endif /*-------------------------------------*/ /* call check_sct_sc */ /*-------------------------------------*/ if (check_sct_sc(sct_id, TRUE)) return (-1); /*-------------------------------------*/ /* create SC command LOCKF */ /*-------------------------------------*/ /* create header */ if (cr_header(SC_LOCKF, sec_mess)) return (-1); /* set parameters */ SCLOCKF.fid = file_id; SCLOCKF.co = CO_LOCK; /* call create_trans */ if (create_trans(sct_id, TRUE)) return (-1); /*----------------------------------------------*/ /* normal end => release response storage */ /*----------------------------------------------*/ sta_aux_bytestr_free(&response);#ifdef TEST fprintf(stdout, "\n***** Normal end of sca_lock_file *****\n\n");#endif return (0);}/*-------------------------------------------------------------*//* E N D O F P R O C E D U R E sca_lock_file *//*-------------------------------------------------------------*//*-------------------------------------------------------------*//* | GMD *//* +-----*//* PROC sca_unlock_file VERSION 1.0 *//* DATE Januar 1992 *//* BY Levona Eckstein *//* *//* DESCRIPTION *//* Unlock working elementary file on the smartcard. *//* *//* *//* IN DESCRIPTION *//* sct_id SCT identifier *//* *//* file_id File identifier *//* *//* file_name File name *//* *//* sec_mess security modes *//* *//* OUT *//* *//* *//* RETURN DESCRIPTION *//* 0 o.k *//* -1 error *//* *//* CALLED FUNCTIONS *//* check_sct_sc ERROR-Codes *//* ENOCARD *//* ESIDUNK *//* ENOSHELL *//* EOPERR *//* EEMPTY *//* EMEMAVAIL *//* ECLERR *//* ERDERR *//* EINVARG *//* ETOOLONG *//* sw1/sw2 from SCT response *//* T1 - ERROR *//* *//* cr_header ERROR-Codes *//* M_ESECMESS *//* *//* *//* create_trans ERROR-Codes *//* EINVARG *//* ETOOLONG *//* EMEMAVAIL *//* ESIDUNK *//* EPARMISSED *//* EPARINC *//* INVPAR *//* EINVINS *//* sw1/sw2 from SCT response *//* T1 - ERROR *//* sw1/sw2 from SC response *//* *//*-------------------------------------------------------------*/intsca_unlock_file(sct_id, file_id, sec_mess) int sct_id; FileId *file_id; SecMess *sec_mess;{ /*----------------------------------------------------------*/ /* Definitions */ /*----------------------------------------------------------*/ /*----------------------------------------------------------*/ /* Statements */ /*----------------------------------------------------------*/#ifdef TEST fprintf(stdout, "\n***** STAMOD-Routine sca_unlock_file *****\n\n"); fprintf(stdout, "TRACE of the input parameters : \n"); fprintf(stdout, "sct_id : %d\n", sct_id); print_fileid(file_id); print_secmess(sec_mess);#endif /*-------------------------------------*/ /* call check_sct_sc */ /*-------------------------------------*/ if (check_sct_sc(sct_id, TRUE)) return (-1); /*-------------------------------------*/ /* create SC command LOCKF */ /*-------------------------------------*/ /* create header */ if (cr_header(SC_LOCKF, sec_mess)) return (-1); /* set parameters */ SCLOCKF.fid = file_id; SCLOCKF.co = CO_UNLOCK; /* call create_trans */ if (create_trans(sct_id, TRUE)) return (-1); /*----------------------------------------------*/ /* normal end => release response storage */ /*----------------------------------------------*/ sta_aux_bytestr_free(&response);#ifdef TEST fprintf(stdout, "\n***** Normal end of sca_unlock_file *****\n\n");#endif return (0);}/*-------------------------------------------------------------*//* E N D O F P R O C E D U R E sca_unlock_file *//*-------------------------------------------------------------*//*-------------------------------------------------------------*//* | GMD *//* +-----*//* PROC sca_delete_file VERSION 1.0 *//* DATE Januar 1992 *//* BY Levona Eckstein *//* *//* DESCRIPTION *//* Delete file on the smartcard. *//* *//* *//* IN DESCRIPTION *//* sct_id SCT identifier *//* *//* file_cat File category (MF,DF,SF ) *//* *//* file_sel File name / File identifier *//* *//* sec_mess security modes *//* *//* OUT *//* *//* *//* RETURN DESCRIPTION *//* 0 o.k *//* -1 error *//* *//* CALLED FUNCTIONS *//* check_sct_sc ERROR-Codes *//* ENOCARD *//* ESIDUNK *//* ENOSHELL *//* EOPERR *//* EEMPTY *//* EMEMAVAIL *//* ECLERR *//* ERDERR *//* EINVARG *//* ETOOLONG *//* sw1/sw2 from SCT response *//* T1 - ERROR *//* *//* cr_header ERROR-Codes *//* M_ESECMESS *//* *//* *//* create_trans ERROR-Codes *//* EINVARG */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -