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

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

?? tlv.c

?? 一個免費的SMART CARD OS系統。
?? 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一区二区三区久久| 精品国产伦一区二区三区免费| 欧美三级日本三级少妇99| 色视频一区二区| 色综合中文字幕国产 | 欧美国产日本视频| 2020日本不卡一区二区视频| 精品福利一二区| 久久精品欧美一区二区三区不卡| 精品sm在线观看| 国产欧美日韩综合精品一区二区 | 国产欧美一区二区三区在线看蜜臀| 91精品欧美福利在线观看| 欧美日韩国产一级| 日韩三级视频在线看| 91精品国模一区二区三区| 宅男在线国产精品| 日韩你懂的在线观看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 国产一区二区三区免费在线观看| 国产麻豆精品一区二区| 成人开心网精品视频| 欧美日韩一区二区在线视频| 欧美系列亚洲系列| 欧美一级黄色片| 久久精品无码一区二区三区| 亚洲欧洲国产日韩| 天堂蜜桃一区二区三区| 国产一区欧美二区| 91影视在线播放| 欧美一级二级在线观看| 中文字幕精品一区| 亚洲成人一区二区在线观看| 精品一区二区三区在线观看国产| 成人国产精品视频| 欧美电影在线免费观看| 国产三级精品视频| 午夜在线成人av| 国产高清在线精品| 欧美美女黄视频| 综合在线观看色| 青娱乐精品视频| 色综合天天综合在线视频| 欧美zozozo| 午夜精品久久久久久不卡8050| 国产成人综合亚洲91猫咪| 精品视频在线免费观看| 欧美国产日韩一二三区| 日本成人在线一区| 欧美亚洲国产bt| 中文字幕在线观看不卡视频| 美女视频第一区二区三区免费观看网站| 成人av影院在线| 久久夜色精品一区| 爽爽淫人综合网网站| 91在线观看下载| 欧美激情在线一区二区| 久久精品理论片| 欧美剧情片在线观看| 亚洲三级久久久| 国产福利一区二区| 欧美成人一级视频| 亚洲成年人影院| 欧洲视频一区二区| 亚洲激情六月丁香| 99精品久久只有精品| 国产精品毛片无遮挡高清| 国产另类ts人妖一区二区| 91精品国产综合久久久蜜臀粉嫩| 亚洲午夜一区二区三区| 99久久精品国产一区| 亚洲日本在线a| 91蜜桃网址入口| 亚洲女同ⅹxx女同tv| 成人av在线电影| 亚洲视频在线观看一区| 91在线高清观看| 一区二区三区精品| 欧美天堂一区二区三区| 亚洲自拍偷拍麻豆| 欧美三级电影在线看| 视频在线观看一区| 4438x亚洲最大成人网| 日韩激情视频网站| 91精品久久久久久蜜臀| 美女任你摸久久| 久久伊99综合婷婷久久伊| 国产精品影视在线观看| 欧美激情综合五月色丁香| 99久久精品国产精品久久| 亚洲伦理在线精品| 欧美日韩黄色影视| 蜜桃视频在线观看一区| 国产色一区二区| 91麻豆国产自产在线观看| 亚洲国产精品久久久久婷婷884 | 国产成人av影院| 自拍偷拍亚洲激情| 欧美日韩精品一区二区| 麻豆91精品91久久久的内涵| 久久久www免费人成精品| 91亚洲永久精品| 日韩国产欧美视频| 久久久亚洲综合| 在线观看亚洲专区| 麻豆精品一二三| 亚洲视频一二三| 日韩午夜电影在线观看| 成人高清视频在线| 丝袜美腿一区二区三区| 久久精品视频在线看| 91国内精品野花午夜精品| 青青草成人在线观看| 国产精品国产三级国产普通话蜜臀| 在线视频国内自拍亚洲视频| 国产一区二区三区四区五区美女 | 丁香啪啪综合成人亚洲小说| 一区二区三区国产精品| 精品久久久久久久久久久院品网 | 日韩一级大片在线| 成人av综合在线| 蜜桃视频在线观看一区二区| 亚洲免费看黄网站| 精品成人免费观看| 欧美日韩www| kk眼镜猥琐国模调教系列一区二区| 秋霞影院一区二区| 一区二区欧美精品| 国产精品福利电影一区二区三区四区| 制服丝袜中文字幕一区| 97精品久久久午夜一区二区三区 | 国产三级精品视频| 日韩欧美国产综合| 欧美午夜理伦三级在线观看| 国产成人a级片| 国产在线视频一区二区| 日本一不卡视频| 亚洲午夜一二三区视频| 亚洲色大成网站www久久九九| 国产丝袜欧美中文另类| 日韩欧美久久久| 欧美酷刑日本凌虐凌虐| 欧美视频一区在线| 91成人国产精品| 日本道精品一区二区三区| 国产jizzjizz一区二区| 国产高清亚洲一区| 国产91对白在线观看九色| 国产麻豆视频一区二区| 精品一区二区精品| 久久av资源网| 激情综合网最新| 国产一区二区视频在线| 国产精品白丝jk黑袜喷水| 国产福利视频一区二区三区| 高清不卡一区二区在线| 北条麻妃一区二区三区| 99久久国产综合精品色伊| 91在线精品秘密一区二区| 色一情一乱一乱一91av| 在线观看91视频| 欧美日韩综合在线免费观看| 欧美日韩小视频| 日韩一区二区三区视频| 久久人人爽人人爽| 亚洲国产激情av| 亚洲精品日韩一| 亚洲第一福利视频在线| 免费观看在线色综合| 国产在线播精品第三| 成人av影视在线观看| 欧美专区日韩专区| 91精品免费在线观看| 久久久国产精华| 一区二区在线观看免费| 日韩avvvv在线播放| 裸体健美xxxx欧美裸体表演| 国产风韵犹存在线视精品| 99国产欧美另类久久久精品| 欧美狂野另类xxxxoooo| 久久先锋影音av| 一区二区视频在线看| 蜜臀va亚洲va欧美va天堂| 不卡一区二区中文字幕| 欧美日韩午夜在线视频| 久久精品一区二区| 一区二区激情小说| 国产综合久久久久久久久久久久 | 欧美日韩一区小说| 亚洲精品在线观看视频| 亚洲欧洲中文日韩久久av乱码| 日日摸夜夜添夜夜添精品视频 | 秋霞电影一区二区| 成人精品亚洲人成在线| 欧美夫妻性生活| |精品福利一区二区三区| 六月丁香综合在线视频| 色婷婷综合激情|