disablepubek.c

来自「IBM开发的TPM的驱动, 有少量的例子可以供参考」· C语言 代码 · 共 42 行

C
42
字号
/****************************************************************************//*                                                                          *//*                    Disable Reading of the Endorsement Key                *//*                                                                          *//*                           Written by J. Kravitz                          *//*                                                                          *//*                     IBM Thomas J. Watson Research Center                 *//*                                                                          *//*                               Version 1.0                                *//*                                                                          *//*                         Last Revision 15 Mar 2004                        *//*                                                                          *//*                           Copyright (C) 2004 IBM                         *//*                                                                          *//****************************************************************************/#include <stdio.h>#include <string.h>#include "tpmfunc.h"int main(int argc, char *argv[]){	int ret;	unsigned char pass1hash[20];	if (argc < 2) {		fprintf(stderr, "Usage: disableekey <owner password>\n");		exit(1);	}	TPM_setlog(0);		/* turn off verbose output */	/*	 ** use the SHA1 hash of the password string as the Owner Authorization Data	 */	TSS_sha1(argv[1], strlen(argv[1]), pass1hash);	ret = TPM_DisableReadPubek(pass1hash);	if (ret != 0) {		fprintf(stderr, "Error %s from TPM_DisableReadPubek\n",			TPM_GetErrMsg(ret));		exit(2);	}	exit(0);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?