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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tlv.c

?? 這是用VB6.0寫的一個通用的CPU卡操作程序,支持PC/SC接口 安裝任何一個PC/SC驅動的IC讀寫器后,都可以使用此程序進行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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久天堂av| 九九国产精品视频| 免费成人av在线| 91蜜桃在线观看| 久久久久久久久久久久久女国产乱| 亚洲欧美色综合| 粉嫩av一区二区三区| 91精品国产综合久久婷婷香蕉| 国产精品美女久久福利网站| 美国十次了思思久久精品导航| 在线中文字幕不卡| 国产精品国产三级国产aⅴ无密码| 蜜芽一区二区三区| 欧美日韩国产一级| 一区二区日韩av| 色综合久久久久综合| 日本一区二区成人在线| 韩国精品一区二区| 欧美一区二区三区视频在线 | 国产成人av自拍| 欧美一区二区三区小说| 亚洲va韩国va欧美va| 色综合久久88色综合天天 | 成人aa视频在线观看| 国产清纯白嫩初高生在线观看91 | 亚洲妇熟xx妇色黄| 色婷婷国产精品| 亚洲激情图片一区| yourporn久久国产精品| 国产精品久久久久久久午夜片 | 久久免费国产精品| 韩国欧美一区二区| 国产亚洲一本大道中文在线| 国产乱子轮精品视频| 久久综合视频网| 丁香激情综合国产| 亚洲欧洲性图库| 91成人免费网站| 丝袜脚交一区二区| 欧美一级理论性理论a| 蜜桃视频在线观看一区二区| 欧美第一区第二区| 久久99国产精品久久99| 久久蜜臀中文字幕| av中文字幕一区| 亚洲一区二区三区影院| 欧美乱妇15p| 美女视频黄 久久| 国产夜色精品一区二区av| gogogo免费视频观看亚洲一| 亚洲精品v日韩精品| 911国产精品| 国产精品99久久久久久有的能看 | 日韩视频在线观看一区二区| 久久99久久99小草精品免视看| 久久天天做天天爱综合色| 国产91精品露脸国语对白| 亚洲美女在线国产| 91精品蜜臀在线一区尤物| 国产成人免费av在线| 夜夜嗨av一区二区三区网页| 91精品国产91久久久久久最新毛片 | 日本不卡免费在线视频| 精品国产自在久精品国产| 成人动漫一区二区在线| 天堂成人国产精品一区| 久久久高清一区二区三区| 在线观看日韩国产| 黑人巨大精品欧美一区| 亚洲狠狠丁香婷婷综合久久久| 91麻豆精品国产91久久久| 国产成人免费网站| 香蕉成人啪国产精品视频综合网| 久久久亚洲精品石原莉奈| 99国内精品久久| 精品一区二区综合| 亚洲精品中文在线观看| xf在线a精品一区二区视频网站| 91亚洲精品乱码久久久久久蜜桃 | 337p亚洲精品色噜噜噜| 成人午夜av电影| 日韩主播视频在线| 国产精品午夜久久| 欧美大片免费久久精品三p| 色综合一区二区| 国产xxx精品视频大全| 日韩国产在线观看| 最新国产成人在线观看| 久久夜色精品国产噜噜av| 欧美亚洲国产一区在线观看网站| 国产成人免费在线| 久久国产尿小便嘘嘘| 天天色 色综合| 亚洲老妇xxxxxx| 国产精品国产a| 久久精品亚洲精品国产欧美 | 一本色道a无线码一区v| 国产精品综合网| 美女www一区二区| 婷婷成人综合网| 亚洲国产精品影院| 亚洲综合色网站| √…a在线天堂一区| 国产网站一区二区三区| 亚洲精品一区在线观看| 日韩一区二区三区视频| 欧美一区二区三区免费观看视频| 在线亚洲免费视频| 一本久久精品一区二区| 国产成人在线观看免费网站| 久久精品国产精品青草| 丝袜美腿亚洲色图| 国产剧情av麻豆香蕉精品| 国产精品久久久99| 国产欧美一区二区三区在线看蜜臀 | 亚洲国产视频一区| 亚洲欧美另类小说视频| 亚洲私人影院在线观看| 亚洲精品一卡二卡| 亚洲自拍偷拍麻豆| 偷偷要91色婷婷| 欧美bbbbb| 久草热8精品视频在线观看| 精品一区二区三区av| 久久精品国产**网站演员| 激情丁香综合五月| 国产精品伊人色| 成人禁用看黄a在线| www.欧美亚洲| 91极品视觉盛宴| www激情久久| 91视频一区二区三区| 91黄色免费网站| 欧美日韩高清一区二区不卡| 日韩一区二区免费电影| 欧美va亚洲va在线观看蝴蝶网| 精品久久久久久久一区二区蜜臀| 久久综合久久99| 久久亚洲一区二区三区明星换脸| 亚洲444eee在线观看| 国产一区二区网址| 免费在线观看精品| √…a在线天堂一区| 亚洲午夜视频在线观看| 久久99热国产| 99re成人在线| 日韩欧美自拍偷拍| 国产精品沙发午睡系列990531| 一区二区三区不卡在线观看| 人禽交欧美网站| a4yy欧美一区二区三区| 精品视频在线视频| 久久精品一区二区| 亚洲一区在线视频观看| 韩国中文字幕2020精品| 在线观看区一区二| 精品国产乱码久久久久久老虎| 亚洲免费观看在线视频| 麻豆国产一区二区| 97成人超碰视| 欧美videos大乳护士334| 亚洲欧美日韩一区二区三区在线观看| 日韩和欧美的一区| 成人97人人超碰人人99| 欧美电影在哪看比较好| 一色桃子久久精品亚洲| 蜜臀精品一区二区三区在线观看 | 2020国产精品| 亚洲va欧美va人人爽午夜| 成人一区二区三区中文字幕| 欧美日韩情趣电影| 中文字幕在线观看不卡| 老司机午夜精品| 欧美肥妇free| 亚洲在线中文字幕| 成+人+亚洲+综合天堂| 日韩欧美第一区| 亚洲国产成人91porn| 91丨porny丨蝌蚪视频| 国产亚洲一区二区三区| 激情综合色综合久久综合| 欧美性受xxxx黑人xyx性爽| 日本一区二区三区视频视频| 久久91精品久久久久久秒播| 欧美群妇大交群中文字幕| 亚洲乱码国产乱码精品精的特点| 国产高清亚洲一区| 日韩欧美www| 日本不卡一区二区三区高清视频| 欧美一区二区高清| 欧美日韩一区二区三区四区 | 国产精品久久久久久久久免费樱桃 | 欧美激情一区二区三区四区 | 91精品国产综合久久精品麻豆| 亚洲另类一区二区| 99r国产精品| 亚洲欧美综合在线精品| 成人白浆超碰人人人人| 国产欧美日韩视频在线观看| 国产乱子轮精品视频|