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

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

?? migrate.c

?? IBM開發(fā)的TPM的驅(qū)動, 有少量的例子可以供參考
?? C
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************************//*                                                                          *//*                         TPM Key Migration Routines                       *//*                                                                          *//*                           Written by J. Kravitz                          *//*                                                                          *//*                     IBM Thomas J. Watson Research Center                 *//*                                                                          *//*                               Version 1.3                                *//*                                                                          *//*                         Last Revision 09 Feb 2004                        *//*                                                                          *//*                           Copyright (C) 2004 IBM                         *//*                                                                          *//****************************************************************************/#include <stdio.h>#include <stdlib.h>#include <string.h>#include <netinet/in.h>#include <tpm.h>#include <tpmutil.h>#include <tpmkeys.h>#include <oiaposap.h>#include <hmac.h>/****************************************************************************//*                                                                          *//* Authorize a Migration Key                                                *//*                                                                          *//* The arguments are...                                                     *//*                                                                          *//* ownpass   is a pointer to the Owner password (20 bytes)                  *//* migtype   is an integer containing 1 for normal migration and 2 for      *//*           rewrap migration                                               *//* keyblob   is a pointer to an area contining the migration public         *//*           encrypted key blob                                             *//* keyblen   is an integer containing the length of the migration           *//*           public key blob                                                *//* migblob   is a pointer to an area which will receive the migration       *//*           key authorization blob                                         *//* migblen   is a pointer to an integer which will receive the migration    *//*           key authorization blob length                                  *//*                                                                          *//****************************************************************************/uint32_t TPM_AuthorizeMigrationKey(unsigned char *ownpass,				   int migtype,				   unsigned char *keyblob,				   unsigned int keyblen,				   unsigned char *migblob,				   unsigned int *migblen){	unsigned char auth_mig_fmt[] = "00 c2 T l s % l % o %";	uint32_t ret;	unsigned char tpmdata[TPM_MAX_BUFF_SIZE];	unsigned char nonceodd[TPM_NONCE_SIZE];	unsigned char evennonce[TPM_NONCE_SIZE];	unsigned char pubauth[TPM_HASH_SIZE];	unsigned char c;	uint32_t ordinal;	uint16_t migscheme;	uint32_t authhandle;	int size;	/* check input arguments */	if (keyblob == NULL || migblob == NULL || migblen == NULL)		return ERR_NULL_ARG;	if (migtype != 1 && migtype != 2)		return ERR_BAD_ARG;	/* generate odd nonce */	TSS_gennonce(nonceodd);	/* Open OIAP Session */	ret = TSS_OIAPopen(&authhandle, evennonce);	if (ret != 0)		return ret;	/* move Network byte order data to variables for hmac calculation */	ordinal = htonl(0x2B);	migscheme = htons(migtype);	c = 0;	/* calculate authorization HMAC value */	ret =	    TSS_authhmac(pubauth, ownpass, TPM_HASH_SIZE, evennonce,			 nonceodd, c, TPM_U32_SIZE, &ordinal, TPM_U16_SIZE,			 &migscheme, keyblen, keyblob, 0, 0);	if (ret != 0) {		TSS_OIAPclose(authhandle);		return ret;	}	/* build the request buffer */	ret = TSS_buildbuff(auth_mig_fmt, tpmdata,			    ordinal,			    migscheme,			    keyblen, keyblob,			    authhandle,			    TPM_NONCE_SIZE, nonceodd,			    c, TPM_HASH_SIZE, pubauth);	if ((ret & ERR_MASK) != 0) {		TSS_OIAPclose(authhandle);		return ret;	}	/* transmit the request buffer to the TPM device and read the reply */	ret = TPM_Transmit(tpmdata, "AuthMigrationKey");	if (ret != 0) {		TSS_OIAPclose(authhandle);		return ret;	}	TSS_OIAPclose(authhandle);	size = TSS_PubKeySize(tpmdata + TPM_DATA_OFFSET, 0);	size += TPM_U16_SIZE + TPM_HASH_SIZE;	/* size of MigrationKeyAuth blob */	ret =	    TSS_checkhmac1(tpmdata, ordinal, nonceodd, ownpass,			   TPM_HASH_SIZE, size, TPM_DATA_OFFSET, 0, 0);	if (ret != 0)		return ret;	memcpy(migblob, tpmdata + TPM_DATA_OFFSET, size);	*migblen = size;	return 0;}/****************************************************************************//*                                                                          *//* Create Migration Blob                                                    *//*                                                                          *//* The arguments are...                                                     *//*                                                                          *//* keyhandle is the handle of the parent key of the key to                  *//*           be migrated.                                                   *//* keyauth   is the authorization data (password) for the parent key        *//*           if null, it is assumed that the parent requires no auth        *//* migauth   is the authorization data (password) for migration of          *//*           the key being migrated                                         *//*           all authorization values must be 20 bytes long                 *//* migtype   is an integer containing 1 for normal migration and 2 for      *//*           rewrap migration                                               *//* migblob   is a pointer to an area to containig the migration key         *//*           authorization blob.                                            *//* migblen   is an integer containing the length of the migration key       *//*           authorization blob                                             *//* keyblob   is a pointer to an area which contains the                     *//*           encrypted key blob of the key being migrated                   *//* keyblen   is an integer containing the length of the encrypted key       *//*           blob for the key being migrated                                *//* rndblob   is a pointer to an area which will receive the random          *//*           string for XOR decryption of the migration blob                *//* rndblen   is a pointer to an integer which will receive the length       *//*           of the random XOR string                                       *//* outblob   is a pointer to an area which will receive the migrated        *//*           key                                                            *//* outblen   is a pointer to an integer which will receive the length       *//*           of the migrated key                                            *//*                                                                          *//****************************************************************************/uint32_t TPM_CreateMigrationBlob(unsigned int keyhandle,				 unsigned char *keyauth,				 unsigned char *migauth,				 int migtype,				 unsigned char *migblob,				 unsigned int migblen,				 unsigned char *keyblob,				 unsigned int keyblen,				 unsigned char *rndblob,				 unsigned int *rndblen,				 unsigned char *outblob,				 unsigned int *outblen){	unsigned char create_mig_fmt[] =	    "00 c3 T l l s % @ l % o % l % o %";	unsigned char create_mig_fmt_noauth[] =	    "00 c2 T l l s % @ l % o %";	uint32_t ret;	unsigned char tpmdata[TPM_MAX_BUFF_SIZE];	unsigned char nonceodd[TPM_NONCE_SIZE];	unsigned char enonce1[TPM_NONCE_SIZE];	unsigned char enonce2[TPM_NONCE_SIZE];	unsigned char c;	uint32_t ordinal;	uint32_t keyhndl;	uint32_t datsize;	uint16_t migscheme;	uint32_t authhandle1;	uint32_t authhandle2;	unsigned char authdata1[TPM_HASH_SIZE];	unsigned char authdata2[TPM_HASH_SIZE];	uint32_t size1;	uint32_t size2;	keydata k;	/* check input arguments */	if (migauth == NULL || migblob == NULL || keyblob == NULL)		return ERR_NULL_ARG;	if (rndblob == NULL || rndblen == NULL || outblob == NULL	    || outblen == NULL)		return ERR_NULL_ARG;	if (migtype != 1 && migtype != 2)		return ERR_BAD_ARG;	TSS_KeyExtract(keyblob, &k);	/* move data to Network byte order variables for HMAC calculation */	ordinal = htonl(0x28);	keyhndl = htonl(keyhandle);	migscheme = htons(migtype);	datsize = htonl(k.privkeylen);	/* generate odd nonce */	TSS_gennonce(nonceodd);	c = 0;	if (keyauth != NULL) {	/* parent key password is required */		/* open TWO OIAP sessions, one for the Parent Key Auth and one for the Migrating Key */		ret = TSS_OIAPopen(&authhandle1, enonce1);		if (ret != 0)			return ret;		ret = TSS_OIAPopen(&authhandle2, enonce2);		if (ret != 0)			return ret;		/* calculate Parent KEY authorization HMAC value */		ret =		    TSS_authhmac(authdata1, keyauth, TPM_HASH_SIZE,				 enonce1, nonceodd, c, TPM_U32_SIZE,				 &ordinal, TPM_U16_SIZE, &migscheme,				 migblen, migblob, TPM_U32_SIZE, &datsize,				 k.privkeylen, k.encprivkey, 0, 0);		if (ret != 0) {			TSS_OIAPclose(authhandle1);			TSS_OIAPclose(authhandle2);			return ret;		}		/* calculate Migration authorization HMAC value */		ret =		    TSS_authhmac(authdata2, migauth, TPM_HASH_SIZE,				 enonce2, nonceodd, c, TPM_U32_SIZE,				 &ordinal, TPM_U16_SIZE, &migscheme,				 migblen, migblob, TPM_U32_SIZE, &datsize,				 k.privkeylen, k.encprivkey, 0, 0);		if (ret != 0) {			TSS_OIAPclose(authhandle1);			TSS_OIAPclose(authhandle2);			return ret;		}		/* build the request buffer */		ret = TSS_buildbuff(create_mig_fmt, tpmdata,				    ordinal,

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区在线免费观看视频| 在线影视一区二区三区| 国产欧美日产一区| 欧美日韩一区二区三区四区| 国产一区二区三区视频在线播放| 亚洲嫩草精品久久| 国产日韩亚洲欧美综合| 精品少妇一区二区三区视频免付费| 99精品桃花视频在线观看| 精一区二区三区| 免费在线观看视频一区| 亚洲成人免费av| 亚洲曰韩产成在线| 日本一区二区三级电影在线观看| 精品国产成人系列| 精品日韩一区二区三区| 精品少妇一区二区三区视频免付费 | 欧美精品一卡两卡| 欧美亚洲综合色| 精品污污网站免费看| 一本久久a久久精品亚洲| 91视频一区二区| 欧美在线小视频| 欧美日韩一区二区三区免费看| 欧美日韩国产精选| 一区二区三区日韩精品视频| 亚洲欧美一区二区三区久本道91| 国产精品久久福利| 一区二区三区视频在线看| 一个色在线综合| 日韩电影在线一区二区三区| 激情六月婷婷久久| 成人免费看片app下载| 91免费小视频| 日韩欧美www| 国产精品久久久久久久蜜臀 | 亚瑟在线精品视频| 久久国产精品一区二区| heyzo一本久久综合| 欧美日韩久久不卡| 久久九九影视网| 亚洲精品乱码久久久久| 国产在线国偷精品免费看| 成人午夜碰碰视频| 在线播放亚洲一区| 国产三级欧美三级| 亚洲v日本v欧美v久久精品| 久久99精品久久久久久国产越南| 成人av片在线观看| 日韩视频免费观看高清完整版| 国产精品免费久久久久| 男人的j进女人的j一区| 99国产精品国产精品久久| 日韩精品一区二区三区在线观看| 国产精品毛片大码女人| 久久69国产一区二区蜜臀| 欧美日韩国产欧美日美国产精品| 国产情人综合久久777777| 蜜臀av性久久久久蜜臀aⅴ| 欧美午夜精品久久久久久孕妇| 国产精品影视在线观看| 欧美精品一级二级| 亚洲第一搞黄网站| 欧美日韩中文国产| 亚洲在线免费播放| 色婷婷精品大在线视频 | 精品一区二区久久| 日韩欧美精品在线| av高清久久久| 欧美国产欧美亚州国产日韩mv天天看完整 | 欧美高清在线精品一区| 国产伦理精品不卡| 中文字幕乱码日本亚洲一区二区| 国产精品一区二区在线看| 久久精品夜色噜噜亚洲a∨| 国产一区二区精品久久91| 国产女人18毛片水真多成人如厕| 国产乱理伦片在线观看夜一区| 国产日韩欧美一区二区三区综合| 狠狠久久亚洲欧美| 中文字幕成人av| 色爱区综合激月婷婷| 蜜桃视频在线一区| 欧美国产精品一区| 欧美偷拍一区二区| 久久国产福利国产秒拍| 国产精品成人一区二区三区夜夜夜 | 久久99精品国产91久久来源| 久久精品一区八戒影视| 在线观看国产一区二区| 韩国欧美国产1区| 亚洲精品ww久久久久久p站| 91精品国产综合久久久蜜臀图片 | 国产精品亚洲第一区在线暖暖韩国| 国产精品成人一区二区艾草| 日韩一区二区三区视频| 99re视频精品| 国内成人免费视频| 婷婷六月综合亚洲| 国产精品天天摸av网| 91精品婷婷国产综合久久性色| 99视频精品全部免费在线| 久久国产夜色精品鲁鲁99| 亚洲免费av观看| 国产精品视频九色porn| 亚洲精品在线免费播放| 欧美私模裸体表演在线观看| caoporn国产一区二区| 国产成人8x视频一区二区| 日韩极品在线观看| 亚洲综合色噜噜狠狠| 樱桃视频在线观看一区| 国产精品嫩草影院av蜜臀| www久久久久| 久久综合九色综合欧美就去吻| 欧美一级日韩一级| 在线不卡中文字幕播放| 欧美日韩黄视频| 欧美日韩免费高清一区色橹橹| 91美女在线观看| 欧美三级电影在线观看| 欧美日韩高清在线| 欧美日韩不卡一区| 欧美日韩国产首页| 欧美一区二区三区不卡| 91精品欧美福利在线观看| 欧美一卡二卡三卡| 欧美精品一区二区久久久| 精品国产亚洲一区二区三区在线观看 | 精品第一国产综合精品aⅴ| 亚洲精品一区二区三区四区高清| 精品久久久久久久久久久久久久久 | 亚洲天堂久久久久久久| 综合色天天鬼久久鬼色| 亚洲大片免费看| 狠狠网亚洲精品| 色婷婷综合久久久中文字幕| 欧美日韩极品在线观看一区| 午夜久久久久久| 国产精品夜夜嗨| 欧美色爱综合网| 久久先锋资源网| 亚洲精品成人天堂一二三| 成人午夜av在线| 在线影视一区二区三区| 久久嫩草精品久久久精品| 亚洲一区二区三区四区中文字幕| 免费日本视频一区| 欧美精品一区二区三| 一区二区三区在线高清| 国产在线精品一区二区不卡了 | 日韩一卡二卡三卡国产欧美| 国产精品二三区| 麻豆91在线看| 91福利在线导航| 国产精品系列在线| 日韩avvvv在线播放| 91极品视觉盛宴| 国产精品乱码久久久久久| 老司机午夜精品| 91精品国产一区二区三区| 亚洲乱码日产精品bd| 国产精品亚洲视频| 26uuu色噜噜精品一区二区| 亚洲va天堂va国产va久| 欧美性色黄大片| 一区二区久久久| 色哟哟国产精品| 日韩毛片精品高清免费| 99久久久免费精品国产一区二区| 欧美国产精品劲爆| 懂色中文一区二区在线播放| 欧美激情一区二区在线| 国产精品一区二区91| 国产欧美日韩另类一区| 成人h动漫精品一区二| 亚洲欧洲色图综合| 91麻豆精品一区二区三区| 又紧又大又爽精品一区二区| 欧美中文字幕一区二区三区亚洲| 一区二区三区不卡在线观看| 欧美三级日本三级少妇99| 午夜成人免费电影| 精品国产三级电影在线观看| 国产麻豆精品95视频| 亚洲三级在线免费观看| 欧美三级欧美一级| 国产一区二区剧情av在线| 中文字幕一区不卡| 欧美人妇做爰xxxⅹ性高电影| 麻豆一区二区在线| 国产精品久99| 日韩美女一区二区三区四区| 国产成人综合亚洲91猫咪| 亚洲乱码精品一二三四区日韩在线| 在线不卡a资源高清| 国产精品一品二品| 日韩精品久久久久久| 国产精品素人视频| 欧美另类videos死尸|