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

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

?? migrate.c

?? IBM開發的TPM的驅動, 有少量的例子可以供參考
?? 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,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕欧美国产| 五月综合激情婷婷六月色窝| 精品视频在线免费| 色综合久久久久久久| 成人丝袜18视频在线观看| 国产自产v一区二区三区c| 国产精品日韩精品欧美在线| 69久久夜色精品国产69蝌蚪网| 亚洲超丰满肉感bbw| 亚洲主播在线观看| 天堂va蜜桃一区二区三区| 亚洲成人精品在线观看| 国产精品18久久久久久久久久久久 | 91影视在线播放| 99国产精品久| 91官网在线免费观看| 欧美日本一道本在线视频| 4438成人网| 一区二区三区四区av| 亚洲成a人片在线观看中文| 成a人片国产精品| 欧美亚洲动漫精品| 欧美成va人片在线观看| 国产精品美女一区二区在线观看| 蜜臀久久久99精品久久久久久| 国产在线麻豆精品观看| 日韩国产欧美在线视频| 欧美日韩视频专区在线播放| 九色综合国产一区二区三区| 成人激情免费电影网址| 亚洲午夜免费电影| 国产精品88888| 国产成人aaa| 国产一区二区三区精品视频 | 国产精品国产三级国产普通话99 | 精品午夜久久福利影院| 欧美精品视频www在线观看| 久久综合九色综合97婷婷| 亚洲天堂成人在线观看| 亚洲成人av一区二区三区| 色狠狠色狠狠综合| 夜夜嗨av一区二区三区网页| 色狠狠av一区二区三区| 亚洲黄色片在线观看| 激情久久久久久久久久久久久久久久| 欧美日韩不卡视频| 看片网站欧美日韩| 在线免费观看日本欧美| 国产午夜精品一区二区三区视频| 亚洲午夜久久久久久久久电影网| 欧美在线影院一区二区| 天堂久久一区二区三区| 日韩欧美一级二级三级久久久| 亚洲精品乱码久久久久| 在线免费精品视频| 久久电影网站中文字幕| 欧美激情一区在线观看| 91搞黄在线观看| 另类人妖一区二区av| 亚洲电影第三页| 欧美福利一区二区| 国产精品白丝av| 亚洲一区二区三区影院| 日韩视频在线观看一区二区| 亚洲国产一区二区三区| 91麻豆精品久久久久蜜臀| 国产精品自产自拍| 亚洲图片有声小说| 久久久精品天堂| 另类欧美日韩国产在线| 国产精品亲子伦对白| 在线亚洲高清视频| 国产一区二区免费视频| 亚洲影院久久精品| 精品久久久久久久久久久久久久久| 成人免费黄色在线| 日本成人超碰在线观看| 中文字幕在线播放不卡一区| 高清久久久久久| 亚洲v日本v欧美v久久精品| 国产亚洲美州欧州综合国| 欧美在线免费观看视频| 国产又黄又大久久| 亚洲影院理伦片| 亚洲欧洲日韩av| 精品久久久久久最新网址| 欧美自拍偷拍一区| 国产成人免费视频一区| 国产精品高清亚洲| 欧美一级高清大全免费观看| 99热精品一区二区| 中文字幕av资源一区| 欧美一级爆毛片| 欧美三级在线看| 99久久免费国产| 国产一区二区三区精品欧美日韩一区二区三区 | 久久亚洲影视婷婷| 99久久精品国产导航| 麻豆精品在线看| 午夜天堂影视香蕉久久| 综合激情网...| 久久精品人人做人人综合| 日韩欧美一区在线观看| 欧美日韩在线播| 一本色道久久综合亚洲精品按摩| 国产精品香蕉一区二区三区| 韩国三级中文字幕hd久久精品| 三级欧美韩日大片在线看| 精品一区二区三区免费视频| 男女男精品视频网| 欧美乱妇一区二区三区不卡视频| 成人app软件下载大全免费| 欧美精品久久天天躁| 国产综合一区二区| 国产精品久久影院| 久久精子c满五个校花| 欧美三级日韩三级| 在线观看中文字幕不卡| 色婷婷综合在线| 91浏览器入口在线观看| 91免费视频观看| 在线观看国产91| 欧美中文字幕一区二区三区 | 日韩欧美一级在线播放| 日韩精品中文字幕一区| 精品国产免费人成在线观看| 久久综合综合久久综合| 看片网站欧美日韩| 国产一区二区美女诱惑| 国产成人精品亚洲777人妖| 国产成人精品免费看| 99久久久精品免费观看国产蜜| 成人高清视频免费观看| 91成人免费在线| av在线不卡观看免费观看| 国产精品灌醉下药二区| 日韩欧美成人一区| 精品国产一区久久| 国产精品久久久久久久久免费樱桃| 国产精品国产三级国产aⅴ入口| 亚洲卡通动漫在线| 青娱乐精品在线视频| 国产精品一品视频| 色综合 综合色| 欧美一区二区三级| 欧美丝袜自拍制服另类| 日韩欧美成人激情| 成人免费视频在线观看| 香蕉久久夜色精品国产使用方法 | 中文字幕亚洲在| 日精品一区二区| 成人午夜激情影院| 欧美性生活一区| 久久久久久毛片| 亚洲一区在线免费观看| 国内精品视频666| 在线观看国产91| 日本一区二区视频在线观看| 久久久99免费| 亚洲午夜精品网| 国产麻豆精品在线观看| 欧美性猛交xxxxxxxx| 国产亚洲一区二区三区在线观看| 亚洲美女免费在线| 一区二区三区精品| 国产在线日韩欧美| 欧美挠脚心视频网站| 国产精品乱码一区二区三区软件| 天天影视网天天综合色在线播放| 国产suv精品一区二区883| 欧美一区二区免费| 亚洲色图制服丝袜| 国产精品一区二区不卡| 日韩一级精品视频在线观看| 亚洲免费观看高清| 国产成人综合在线| 日韩欧美综合在线| 午夜日韩在线观看| 97se亚洲国产综合自在线| 久久综合色8888| 免费成人美女在线观看.| 在线日韩av片| 亚洲精品日韩专区silk| 成人sese在线| 国产视频不卡一区| 国产在线精品一区二区不卡了| 欧美福利电影网| 天堂va蜜桃一区二区三区 | 日本欧美大码aⅴ在线播放| 色吧成人激情小说| 日韩一区欧美一区| 成人成人成人在线视频| 日本一区二区三区免费乱视频| 黄页网站大全一区二区| 日韩视频在线观看一区二区| 日韩精品欧美成人高清一区二区| 欧美探花视频资源| 日韩精品一区第一页| 91精品国产综合久久久久久漫画| 亚洲香肠在线观看|