OLD | NEW |
(Empty) | |
| 1 /* Software-based Mobile Trusted Module (MTM) Emulator |
| 2 * Copyright (C) 2004-2010 Mario Strasser <mast@gmx.net> |
| 3 * Copyright (C) 2007 Jan-Erik Ekberg <jan-erik.ekberg@nokia.com>, |
| 4 * Nokia Corporation and/or its subsidiary(-ies) |
| 5 * |
| 6 * This module is free software; you can redistribute it and/or modify |
| 7 * it under the terms of the GNU General Public License as published |
| 8 * by the Free Software Foundation; either version 2 of the License, |
| 9 * or (at your option) any later version. |
| 10 * |
| 11 * This module is distributed in the hope that it will be useful, |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 * GNU General Public License for more details. |
| 15 * |
| 16 * $Id$ |
| 17 */ |
| 18 |
| 19 #ifndef _MTM_COMMANDS_H_ |
| 20 #define _MTM_COMMANDS_H_ |
| 21 |
| 22 #include "mtm_structures.h" |
| 23 |
| 24 /* |
| 25 * Modified TPM commands |
| 26 */ |
| 27 |
| 28 /** |
| 29 * MTM_Extend - adds a new measurement to a PCR |
| 30 * @pcrNum: [in] The PCR to be updated |
| 31 * @inDigest: [in] The 160 bit value representing the event to be recorded |
| 32 * @outDigest: [out] The PCR value after execution of the command |
| 33 * Returns: TPM_SUCCESS on success, a TPM error code otherwise. |
| 34 */ |
| 35 TPM_RESULT MTM_Extend( |
| 36 TPM_PCRINDEX pcrNum, |
| 37 TPM_DIGEST *inDigest, |
| 38 TPM_PCRVALUE *outDigest |
| 39 ); |
| 40 |
| 41 /** |
| 42 * MTM_PCR_Reset - resets the indicated PCRs |
| 43 * @pcrSelection: [in] The PCRs to reset |
| 44 * Returns: TPM_SUCCESS on success, a TPM error code otherwise. |
| 45 */ |
| 46 TPM_RESULT MTM_PCR_Reset( |
| 47 TPM_PCR_SELECTION *pcrSelection |
| 48 ); |
| 49 |
| 50 /** |
| 51 * MTM_GetCapability - provides current information regarding the TPM |
| 52 * @capArea: [in] Partition of capabilities to be interrogated |
| 53 * @subCapSize: [in] Size of subCap parameter |
| 54 * @subCap: [in] Further definition of information |
| 55 * @respSize: [out] The length of the returned capability response |
| 56 * @resp: [out] The capability response |
| 57 * Returns: TPM_SUCCESS on success, a TPM error code otherwise. |
| 58 */ |
| 59 TPM_RESULT MTM_GetCapability( |
| 60 TPM_CAPABILITY_AREA capArea, |
| 61 UINT32 subCapSize, |
| 62 BYTE *subCap, |
| 63 UINT32 *respSize, |
| 64 BYTE **resp |
| 65 ); |
| 66 |
| 67 /** |
| 68 * MTM_ReleaseCounter - releases a counter |
| 69 * @countID: [in] ID value of the counter |
| 70 * @auth1: [in, out] Authorization protocol parameters |
| 71 * Returns: TPM_SUCCESS on success, a TPM error code otherwise. |
| 72 */ |
| 73 TPM_RESULT MTM_ReleaseCounter( |
| 74 TPM_COUNT_ID countID, |
| 75 TPM_AUTH *auth1 |
| 76 ); |
| 77 |
| 78 /** |
| 79 * MTM_ReleaseCounterOwner - releases a counter |
| 80 * @countID: [in] ID value of the counter |
| 81 * @auth1: [in, out] Authorization protocol parameters |
| 82 * Returns: TPM_SUCCESS on success, a TPM error code otherwise. |
| 83 */ |
| 84 TPM_RESULT MTM_ReleaseCounterOwner( |
| 85 TPM_COUNT_ID countID, |
| 86 TPM_AUTH *auth1 |
| 87 ); |
| 88 |
| 89 /** |
| 90 * MTM_FlushSpecific - flushes a specific handle |
| 91 * @handle: [in] Handle of the item to flush |
| 92 * @resourceType: [in] The type of resource that is being flushed |
| 93 * Returns: TPM_SUCCESS on success, a TPM error code otherwise. |
| 94 */ |
| 95 TPM_RESULT MTM_FlushSpecific( |
| 96 TPM_HANDLE handle, |
| 97 TPM_RESOURCE_TYPE resourceType |
| 98 ); |
| 99 |
| 100 /* |
| 101 * Additional, MTM specific commands |
| 102 */ |
| 103 |
| 104 /** |
| 105 * MTM_InstallRIM - generates internal RIM certificates. |
| 106 * @rimCertIn: [in] Data to be used for internal RIM certificate |
| 107 * @auth1: [in, out] Authorization protocol parameters |
| 108 * @rimCertOut: [out] An internal RIM certificate |
| 109 * Returns: TPM_SUCCESS on success, a TPM error code otherwise. |
| 110 * |
| 111 * Description: ([MTM_spec, v1.0], Section 7.2) |
| 112 */ |
| 113 TPM_RESULT MTM_InstallRIM( |
| 114 TPM_RIM_CERTIFICATE *rimCertIn, |
| 115 TPM_AUTH *auth1, |
| 116 TPM_RIM_CERTIFICATE *rimCertOut |
| 117 ); |
| 118 |
| 119 /** |
| 120 * MTM_LoadVerificationKey - load one Verification Key into the MTM |
| 121 * @parentKey: [in] Parent key used to verify this key |
| 122 * @auth1: [in, out] Authorization protocol parameters |
| 123 * @verificationKeyHandle: [out] Handle for the key that was loaded |
| 124 * @loadMethod: [out] which method was used to load this verification key |
| 125 * Returns: TPM_SUCCESS on success, a TPM error code otherwise. |
| 126 * |
| 127 * Description: ([MTM_spec, v1.0], Section 7.3) |
| 128 */ |
| 129 TPM_RESULT MTM_LoadVerificationKey( |
| 130 TPM_VERIFICATION_KEY_HANDLE parentKey, |
| 131 TPM_VERIFICATION_KEY *verificationKey, |
| 132 TPM_AUTH *auth1, |
| 133 TPM_VERIFICATION_KEY_HANDLE *verificationKeyHandle, |
| 134 BYTE *loadMethod |
| 135 ); |
| 136 |
| 137 /** |
| 138 * MTM_LoadVerificationRootKeyDisable - disables the functionality to load Verif
ication Root Keys. |
| 139 * Returns: TPM_SUCCESS |
| 140 * |
| 141 * Description: ([MTM_spec, v1.0], Section 7.4) |
| 142 */ |
| 143 TPM_RESULT MTM_LoadVerificationRootKeyDisable(); |
| 144 |
| 145 /** |
| 146 * MTM_VerifyRIMCert - verify an internal or external RIM certificate. |
| 147 * @rimCert: [in] RIM certificate to be validated |
| 148 * @rimKey: [in] Key handle for the verification. NULL if internal verification
key is used. |
| 149 * Returns: TPM_SUCCESS on success, a TPM error code otherwise. |
| 150 * |
| 151 * Description: ([MTM_spec, v1.0], Section 7.5) |
| 152 */ |
| 153 TPM_RESULT MTM_VerifyRIMCert( |
| 154 TPM_RIM_CERTIFICATE* rimCert, |
| 155 TPM_VERIFICATION_KEY_HANDLE rimKey |
| 156 ); |
| 157 |
| 158 /** |
| 159 * MTM_VerifyRIMCertAndExtend - verify an internal or external RIM certificate a
nd extend PCR given in RIM certificate. |
| 160 * @rimCert: [in] RIM certificate to be validated |
| 161 * @rimKey: [in] Key handle for the verification key. NULL if internal verificat
ion key is used. |
| 162 * @outDigest: [out] The PCR value after the execution of the command |
| 163 * Returns: TPM_SUCCESS on success, a TPM error code otherwise. |
| 164 * |
| 165 * Description: ([MTM_spec, v1.0], Section 7.6) |
| 166 */ |
| 167 TPM_RESULT MTM_VerifyRIMCertAndExtend( |
| 168 TPM_RIM_CERTIFICATE *rimCert, |
| 169 TPM_VERIFICATION_KEY_HANDLE rimKey, |
| 170 TPM_PCRVALUE *outDigest |
| 171 ); |
| 172 |
| 173 /** |
| 174 * MTM_IncrementBootstrapCounter - increment bootstrap counter in MTM permanent
data. |
| 175 * @rimCert: [in] A RIM certificate |
| 176 * @rimKey: [in] Key handle for the verification key to be used |
| 177 * Returns: TPM_SUCCESS on success, a TPM error code otherwise. |
| 178 * |
| 179 * Description: ([MTM_spec, v1.0], Section 7.7) |
| 180 */ |
| 181 TPM_RESULT MTM_IncrementBootstrapCounter( |
| 182 TPM_RIM_CERTIFICATE *rimCert, |
| 183 TPM_VERIFICATION_KEY_HANDLE rimKey |
| 184 ); |
| 185 |
| 186 /** |
| 187 * MTM_SetVerifiedPCRSelection - Set verifiedPCRs field in MTM_PERMANENT_DATA |
| 188 * @verifiedSelection: [in] Set of PCRs that can only be extended with this func
tion |
| 189 * @auth1: [in, out] Authorization protocol parameters |
| 190 * Returns: TPM_SUCCESS on success, a TPM error code otherwise. |
| 191 * |
| 192 * Description: ([MTM_spec, v1.0], Section 7.8) |
| 193 */ |
| 194 TPM_RESULT MTM_SetVerifiedPCRSelection( |
| 195 TPM_PCR_SELECTION *verifiedSelection, |
| 196 TPM_AUTH *auth1 |
| 197 ); |
| 198 |
| 199 TPM_RESULT mtm_execute_command(TPM_REQUEST *req, TPM_RESPONSE *rsp); |
| 200 |
| 201 #endif /* _MTM_COMMANDS_H_ */ |
OLD | NEW |