亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tlv.c

?? 這是用VB6.0寫的一個(gè)通用的CPU卡操作程序,支持PC/SC接口 安裝任何一個(gè)PC/SC驅(qū)動(dòng)的IC讀寫器后,都可以使用此程序進(jìn)行CPU卡的測試
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* ============================================================================   Project Name : jayaCard   Module Name  : proto/bios/lv/tlv.c   Version : $Id: tlv.c,v 1.6 2004/01/11 09:56:31 dgil Exp $	Description: TLV (short TLV - tag length value)    The Original Code is jayaCard code.    The Initial Developer of the Original Code is Gilles Dumortier.	Portions created by the Initial Developer are Copyright (C) 2002-2004 the    Initial Developer. All Rights Reserved.    Contributor(s):    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; see http://www.gnu.org/licenses/gpl.html   History Rev	Description   050903 dgil	Wrote it from experimental/ber (seek a tag)   081003 dgil	More integration from experimental/ber (update, append a tag)   ============================================================================*/#include "precomp.h"#ifdef JAYA_TLV/* ============================================================================    Annex D Use of the basic encoding rules of ASN.1    D.1 BER-TLV data object    Each BER-TLV data object (see ISO/IEC 8825) shall consist of 2 or 3    consecutive fields :    The tag filed T consists of one or more consecutive bytes. It encodes a    class, a type and a number.    The length field consists of one or more consecutive bytes. It encodes    an integer L.    If L is not null, then the value field V consists of L consecutive bytes.    If L is null, then the data object is empty: there is no value field.    ISO/IEC 7816 uses neither '00' nor 'FF' as tag value.    NOTE - Before, between or after BER-TLV data objects, '00' or 'FF' bytes    without any meaning may occur (e.g. due to erased or modified TLV-coded    data objects).    D.2 Tag field    The bits B8 and B7 of the leading byte of tag field shall encode the tag    class, i.e. the class of the data object.    B8-7='00' introduces a tag of universal class    B8-7='01' introduces a tag of application class    B8-7='10' introduces a tag of context-specific class    B8-7='11' introduces a tag of private class    The bit B6 of the leading byte of the tag field shall encode the tag type,    i.e. the type of the data object.    B6=0 introduces a primitive data object    B6=1 introduces a constructed data object    If the bits B5-B1 of the leading byte are not all set to 1, then may they    shall encode an integer equal to the tag number which therefore lies in the    range from 0 to 30. Then the tag field consists of a single byte.    Otherwise (B5-B1 set to 1 in the leading byte), the tag field shall    continue on one or more shubsequent bytes.    The bit B8 of each subsequent byte shall be set to 1, unless it is the    last subsequent byte    The bits B7-B1 of the first subsequent byte shall not be all set to 0    The bits B7-B1 of the first subsequent byte, folowed by the bits B7 to B1    of each further subsequent byte, up to and including the bits B7-B1 of    the last subsequent byte, shall encode an integer equal to the tag    number (thus strictly positive).    D.3 Length field    In short form, the length field consists of a single byte where the bit B8    shall be set to 0 and the bits B7-B1 shall encode an integer equal to the    number of bytes in the value field. Any length from 0-127 can thus be    encoded by 1 byte.    In long form, the length field consists of a leading byte where the bit B8    shall be set to 1 and the B7-B1 shall not be all equal, thus encoding a    positive integer equal to the number of subsequent bytes in the length    field. Those subsequent bytes shall encode an integer equal to the number    of bytes in the value field. Any length within the APDU limit (up to 65535)    can thus be encoded by 3 bytes.    NOTE - ISO/IEC 7816 does not use the indefinite lengths specified by the    basic encoding rules of ASN.1 (see ISO/IEC 8825).    D.4 Value field    In this part of ISO/IEC 7816, the value field of some primitive BER-TLV    data objects consists of zero, one or more SIMPLE-TLV data objects.    The value field of any other primitive BER-TLV data object consists of    zero, one or more data elements fixed by the specifications of the data    objects.    The value field of each constructed BER-TLV data object consists of zero,    one or more BER-TLV data objects.   ========================================================================= *//* ============================================================================	These functions are using current_EF header to move inside the TLV area		base address is : current_EF.u3.body_ef 		end address is  : current_EF.u3.body_ef+current_EF.u4.sizefile	In the case JAYA_FILESYSTEM is undefined BUT you want TLV support inside	your eeprom area, you need :		#define JAYA_TLV 		to have this module		current_EF.u3.body_ef	fixed to the base address of your TLV area		current_EF.u4.sizefile	fixed to the size of your TLV area	Also, __tlv_init_area() must be called during the eeprom bootstrap.   ========================================================================= *//* ============================================================================	__tlv_size_of_length()   ========================================================================= */jbyte	__tlv_size_of_length(jword len){	if (len<=127) return 1;	if (len<=255) return 2;	return 3;}/* ============================================================================    __tlv_init_area()	Initialise the file content for TLV management. MUST be called when the	file is created to embedded TLV.   ========================================================================= */void __tlv_init_area(void){    current_tlv = header_file.u3.body_ef;    next_tlv = header_file.u3.body_ef;    HAL_ERASE_EEPROM(header_file.u3.body_ef,header_file.u4.sizefile,0xFF);	LOG3("TLV","__tlv_init_area(): start=0x%.4X size=%d end=0x%.4X",		header_file.u3.body_ef,		header_file.u4.sizefile,		header_file.u3.body_ef+header_file.u4.sizefile		);}/* ============================================================================    __tlv_get_tag()    assume: next_tlv is the address of the first byte of a TLV structure    update current_tlv_tag, current_tlv_len and current_tlv_val with the    current TLV ber.    returns: address of the next TLV ber if no error, next_tlv otherwise.   ========================================================================= */jword __tlv_get_tag(void){    LOCAL(jbyte,b);    LOCAL(jword,adr);    current_tlv = next_tlv;    adr = current_tlv;    if (adr>(current_EF.u3.body_ef+current_EF.u4.sizefile)) {	/* hmmm ... */        BIOS_SETERR(ERR_TAG_NOT_FOUND);        return next_tlv;    }next_byte:    /* read the first byte of Tag */    b = HAL_EEPROM_READ_BYTE(adr); adr++;    /* invalid Tag ? (could be the end of the used area) */    if ((b==0x00) || (b==0xFF)) {        if (adr<=(current_EF.u3.body_ef+current_EF.u4.sizefile)) goto next_byte;invalid:        BIOS_SETERR(ERR_INVALID_TAG);        return next_tlv;    }    if ((b&0x1F)==0x1F) {        /* tag on next byte */		current_tlv_tag = b;        b = HAL_EEPROM_READ_BYTE(adr); adr++;		if ((b&0x7F)==0) goto invalid;        if ((b&0x80)==0x80) goto invalid;		current_tlv_tag = (current_tlv_tag<<8) + b;    } else {        /* tag on b */        current_tlv_tag = b;    }    /* read the first byte of Length */    b = HAL_EEPROM_READ_BYTE(adr); adr++;    if ((b&0x80)==0x00) {        /* short form */        current_tlv_len = (jword)b;    } else {        /* long form */		if (b==0x81) {			/* two bytes */			current_tlv_len = (jword)HAL_EEPROM_READ_BYTE(adr); adr++;		} else if (b==0x82) {			/* three bytes */			current_tlv_len = HAL_EEPROM_READ_WORD(adr); adr +=2 ;		} else {            /* limit to 65536 bytes */            BIOS_SETERR(ERR_INVALID_LENGTH);            return next_tlv;		}    }   /* next byte is the Value */   current_tlv_val = adr;    return adr+current_tlv_len;}/* ============================================================================    __tlv_seek_first_tag()	Seek the first occurence of a tag in the current EF body content    update current_tlv, current_tlv_tag, current_tlv_len and current_tlv_val    with the found TLV ber.	return jtrue if the tag has been found, jfalse otherwise.   ========================================================================= */#ifdef JAYACFG_DO_NOT_SUPPORT_RETURNTYPE_JBOOLjbyte __tlv_seek_first_tag(jword tag)#elsejbool __tlv_seek_first_tag(jword tag)#endif{    next_tlv = current_EF.u3.body_ef;	LOG1("TLV","__tlv_seek_first_tag(): tag = %.4X",tag);	return __tlv_seek_next_tag(tag);}/* ============================================================================    __tlv_seek_next_tag()	Seek the next occurence of a tag in the current EF body content

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区免费高清| 全国精品久久少妇| 久久久噜噜噜久久人人看| 日韩欧美在线网站| 日韩一区二区精品在线观看| 制服丝袜av成人在线看| 日韩午夜激情视频| 久久嫩草精品久久久精品一| 26uuu国产日韩综合| 日本一区二区电影| 中文字幕一区二区三区在线观看| 亚洲欧美综合色| 一区二区三区在线视频观看58| 亚洲亚洲人成综合网络| 日本中文字幕不卡| 国产一区不卡在线| 91在线观看美女| 欧美久久久久久久久| 精品久久国产字幕高潮| 亚洲欧洲在线观看av| 日韩精品一级二级| 国产高清在线观看免费不卡| 色婷婷av一区二区三区gif | 国产欧美精品在线观看| 成人欧美一区二区三区白人| 午夜电影网亚洲视频| 国产一区二区三区黄视频 | 日产国产高清一区二区三区 | 成人av在线一区二区| 欧美最猛黑人xxxxx猛交| 精品久久久久久亚洲综合网| 中文字幕亚洲精品在线观看| 亚洲成人一二三| 国产99久久久久| 91精品国模一区二区三区| 中文字幕精品在线不卡| 日本vs亚洲vs韩国一区三区 | 91在线视频18| 欧美不卡在线视频| 亚洲精选一二三| 国产在线播放一区三区四| 欧美日韩一区二区在线视频| 国产亚洲一区二区在线观看| 亚洲成人资源在线| 成人免费视频app| 精品三级av在线| 亚洲一区二区五区| 成人丝袜18视频在线观看| 91精品国产品国语在线不卡| 亚洲色图清纯唯美| 国产精品1区2区| 欧美电影免费提供在线观看| 偷拍亚洲欧洲综合| 99re66热这里只有精品3直播 | www.av精品| 久久影音资源网| 免费观看久久久4p| 欧美体内she精高潮| 国产午夜精品久久| 国产又黄又大久久| 欧美成人a视频| 麻豆国产精品一区二区三区| 精品视频在线免费看| 亚洲精品自拍动漫在线| 国产91丝袜在线观看| 久久综合狠狠综合| 国产馆精品极品| 久久久久久久久免费| 国产一区二区免费在线| 精品噜噜噜噜久久久久久久久试看 | 日韩亚洲欧美综合| 天堂蜜桃一区二区三区 | 国产一区二区三区高清播放| 日韩欧美区一区二| 国内精品伊人久久久久av影院 | 日韩精品资源二区在线| 亚洲国产精品一区二区尤物区| 在线观看视频欧美| 亚洲第一av色| 91精品久久久久久久91蜜桃| 日韩av中文在线观看| 欧美一区二区视频在线观看| 精品一区二区三区不卡| 久久久欧美精品sm网站| 粉嫩蜜臀av国产精品网站| 国产精品色婷婷久久58| av亚洲精华国产精华精| 夜夜嗨av一区二区三区| 欧美日韩视频在线第一区| 免费在线成人网| 国产日韩欧美精品在线| 一本一道综合狠狠老| 偷窥少妇高潮呻吟av久久免费| 欧美一区二区三区婷婷月色| 国产麻豆日韩欧美久久| 亚洲少妇屁股交4| 欧美日韩一区三区| 国产精品资源在线看| 亚洲视频图片小说| 欧美一区二区日韩| 国产成人免费9x9x人网站视频| 亚洲精品免费在线| 日韩午夜av电影| 9i在线看片成人免费| 亚洲 欧美综合在线网络| 精品电影一区二区三区| 一本到不卡精品视频在线观看| 丝袜美腿亚洲色图| 国产日韩欧美不卡| 欧美日韩久久一区| www.综合网.com| 蜜臀久久久99精品久久久久久| 中文字幕av一区二区三区高| 91麻豆精品国产91久久久更新时间| 狠狠色2019综合网| 亚洲成av人片一区二区| 日本一区二区综合亚洲| 欧美剧情片在线观看| www.爱久久.com| 国模套图日韩精品一区二区| 亚洲综合色在线| 国产精品久久久一区麻豆最新章节| 欧美视频完全免费看| 91美女片黄在线观看91美女| 精久久久久久久久久久| 午夜精品久久久久久久| 亚洲精品国产精品乱码不99| 亚洲精品一区二区在线观看| 欧美电影一区二区三区| 99精品欧美一区二区三区综合在线| 免费看欧美女人艹b| 五月激情综合网| 亚洲男人天堂av| 一区视频在线播放| 国产精品三级视频| 久久久久久亚洲综合| 日韩欧美国产高清| 欧美日韩国产首页在线观看| 91麻豆国产自产在线观看| 国产精品911| 精品一区二区免费视频| 极品少妇一区二区三区精品视频 | 亚洲不卡av一区二区三区| 国产三级一区二区三区| 久久精品亚洲精品国产欧美kt∨ | 欧美日韩精品一区二区三区四区| 99热在这里有精品免费| 国产+成+人+亚洲欧洲自线| 国产剧情一区二区| 国产一区二区伦理| 国产乱人伦偷精品视频免下载| 日本中文字幕一区二区有限公司| 午夜不卡av免费| 首页国产欧美久久| 日韩国产欧美一区二区三区| 日韩av一级片| 蜜桃视频在线一区| 狠狠色伊人亚洲综合成人| 久久国产精品72免费观看| 国产一区二区在线看| 国产一区视频在线看| 丁香激情综合五月| 色婷婷香蕉在线一区二区| 欧美日韩aaaaaa| 欧美肥妇free| 久久久电影一区二区三区| 国产精品美女一区二区在线观看| 国产精品久久久久久久午夜片| 国产精品久久久久久久午夜片| 樱花草国产18久久久久| 三级久久三级久久久| 国产一区二区h| 91蝌蚪国产九色| 在线播放日韩导航| 亚洲精品一区二区三区四区高清| 久久精品欧美日韩精品| 一区二区三区国产精华| 日本不卡在线视频| 成人午夜视频福利| 欧美最新大片在线看| 精品国产一区二区三区av性色 | 免费av网站大全久久| 国产91丝袜在线观看| 欧美日韩国产三级| 久久久久国产精品免费免费搜索| 亚洲黄一区二区三区| 蜜臀久久久99精品久久久久久| 国产成人免费视频| 欧美精品丝袜久久久中文字幕| 久久久夜色精品亚洲| 亚洲午夜精品17c| 成人亚洲一区二区一| 欧美一区二区日韩| 亚洲欧美色一区| 国产在线精品国自产拍免费| 欧美色视频一区| 国产精品日韩精品欧美在线| 日韩中文字幕区一区有砖一区| 国产成人av一区二区三区在线 | 国产一区在线看|