TCG Device Driver library · Example a How many pcrs do lo you have? Client Command PARAM HMAC Type Name Description TPM TAG TPM TAG oMMAnD UINT32 paramSize Total number of input bytes including param Size and tag TPM COMMAND CODE ordinal Command ordinal: TPM_ORD_GetCapability TPM_CAPABILITY_ AREa capArea Partition of capabilities to be interrogated UINT32 sub Cap Size Size of sub Cap parameter BYTEl hubCap Further definition of information TPM_GetCapability Command 命令标识 0x00C1 TPM TAG RQU COMMAND 包大小 0x×00000016 Command size: 22 bytes(0x16) 命令索引 0×00000065 TPM ORD Getcapability 功能域 00000005 TPM CAP PROPERTY 功能子域大小 0c000004 Sub capability size: 4 bytes 功能子域 0X×000001 TPM CAP PROP PCR TCG Software Stack 16
16 TCG Device Driver Library • Example A: PARAM HMAC Type Name Description # SZ # SZ 1 2 TPM_TAG tag TPM_TAG_RQU_COMMAND 2 4 UINT32 paramSize Total number of input bytes including paramSize and tag 3 4 TPM_COMMAND_CODE ordinal Command ordinal: TPM_ORD_GetCapability 4 4 TPM_CAPABILITY_AREA capArea Partition of capabilities to be interrogated 5 4 UINT32 subCapSize Size of subCap parameter 6 <> BYTE[] subCap Further definition of information TCG Software Stack Command How many PCRs do you have? TPM_GetCapability Command 命令标识 0x00 C1 包大小 0x00 00 00 16 命令索引 0x00 00 00 65 功能域 0x00 00 00 05 功能子域大小 0c00 00 00 04 功能子域 0x00 00 01 01 … TPM_TAG_RQU_COMMAND … Command size: 22 bytes (0x16) … TPM_ORD_GetCapability … TPM_CAP_PROPERTY … Sub capability size: 4 bytes … TPM_CAP_PROP_PCR
TCG Device Driver library Example a Ok. listen: 24 Client Result PARAM HMAC Type Name Description TPM TAG TPM TAG RSP COMMAND UINT2 paramSize Total number ofoutput bytes including param Size and tag TPM RESULT The return code of the operation UINT32 respSize The length of the retumed capability response BYTEl resp The capability response TPM_GetCapabilitfy Response 命令标识 0x00c4 TPM TAG RSP COMMAND 包大小 000000012 Response size: 18 bytes(0x12) 返回码 0×00000000 TPM SUCCESS 响应净荷大小 0×0000004 Response payload size: 4 bytes 响应数据大小 0c00000018 Response data: 0x18... 24 PCRs TCG Software Stack
17 TCG Device Driver Library • Example A: TCG Software Stack Result Ok, listen: 24. PARAM HMAC Type Name Description # SZ # SZ 1 2 TPM_TAG tag TPM_TAG_RSP_COMMAND 2 4 UINT32 paramSize Total number of output bytes including paramSize and tag 3 4 TPM_RESULT returnCode The return code of the operation. 4 4 UINT32 respSize The length of the returned capability response 5 <> BYTE[ ] resp The capability response TPM_GetCapability Response 命令标识 0x00 C4 包大小 0x00 00 00 12 返回码 0x00 00 00 00 响应净荷大小 0x00 00 00 04 响应数据大小 0c00 00 00 18 … TPM_TAG_RSP_COMMAND … Response size: 18 bytes (0x12) … TPM_SUCCESS … Response payload size: 4 bytes … Response data: 0x18 … 24 PCRs
TCG Device Driver library · Programme 1 UUUC 00025 00026 00027 unsigned char random_ cmd[]=i 0, TPM TAG RQU COMMAND ∥获取8个字节随机数 0,0.0.14 00030 0. 0.0. TPM ORD GetRandom 00031 0.0.0.8 00032 00033 00034 unsigned char tpm shalstart[]= ∥使能SHA-1; 00035 0, TPM TAG RQU COMMAND 00036 0.0.0 0.0.0 ORD SHA1Start 00038 00039 00040 unsigned char tpm shal complete[]= 00041 0, TPM TAG RQU COMMAND ∥需加密的数据,64个字节 00042 0.0.0.78 00043 0,0,0, TPM_ORD_SHAlComplete 00044 0.0.0.64 00045 1,2,3,4 64 00046 00047 TCG Software Stack
18 TCG Device Driver Library • Programme 1. TCG Software Stack // 获取8个字节随机数; // 使能SHA-1; // 需加密的数据,64个字节;
TCG Device Driver library TPM Authorization protocols authorization 能够证明请求者拥有执行某个TPM功能和使用 某些对象的许可。 ·用双方共享秘密(授权数据)进行证明,无其他 方式。 Authorization data 是一个在用户和TPM之间共享的160bit秘密值 ·由用户创建,可以看做是 password ·SRK及 TPM Owner的授权数据要保存在TPM内部非易失 性存储区内,而其他对象的授权数据则要与其自身进行 绑定。 TCG Software Stack
19 TCG Device Driver Library • TPM Authorization Protocols – Authorization • 能够证明请求者拥有执行某个TPM功能和使用 某些对象的许可。 • 用双方共享秘密(授权数据 )进行证明,无其他 方式。 – Authorization Data • 是一个在用户和TPM之间共享的160bit秘密值 • 由用户创建,可以看做是password • SRK及TPM Owner的授权数据要保存在TPM内部非易失 性存储区内,而其他对象的授权数据则要与其自身进行 绑定。 TCG Software Stack
TCG Device Driver library TPM Authorization protocols Object Independent authorization Protocol (OIAP) ·为提高效率而设计,在一个授权会话中可以验证一个或 多个不同的对象 ·验证的过程使用双方共享的秘密值(授权数据) Object Specific Authorization Protocol(OSAP) ·在一个授权会话中仅对一个对象进行操作 ·验证的过程使用双方共享的秘密值(授权数据) ·设置或重新设置授权数据的时候必须使用该协议 TCG Software Stack
20 TCG Device Driver Library • TPM Authorization Protocols – Object Independent Authorization Protocol (OIAP) • 为提高效率而设计,在一个授权会话中可以验证一个或 多个不同的对象 • 验证的过程使用双方共享的秘密值(授权数据) – Object Specific Authorization Protocol (OSAP) • 在一个授权会话中仅对一个对象进行操作 • 验证的过程使用双方共享的秘密值(授权数据) • 设置或重新设置授权数据的时候必须使用该协议 TCG Software Stack