コード例 #1
0
TPM_RC Tss2_Sys_NV_Read(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_RH_NV_AUTH	authHandle,
    TPMI_RH_NV_INDEX	nvIndex,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    UINT16	size,
    UINT16	offset,
    TPM2B_MAX_NV_BUFFER	*data,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_NV_Read_Prepare( sysContext, authHandle, nvIndex, size, offset );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_NV_Read_Complete( sysContext, data );
        }
    }
    
    return rval;
}
コード例 #2
0
TPM_RC Tss2_Sys_PCR_Event(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_PCR	pcrHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_EVENT	*eventData,
    TPML_DIGEST_VALUES	*digests,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_PCR_Event_Prepare( sysContext, pcrHandle, eventData );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_PCR_Event_Complete( sysContext, digests );
        }
    }
    
    return rval;
}
コード例 #3
0
TPM_RC Tss2_Sys_FieldUpgradeData(
    TSS2_SYS_CONTEXT *sysContext,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_MAX_BUFFER	*fuData,
    TPMT_HA	*nextDigest,
    TPMT_HA	*firstDigest,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_FieldUpgradeData_Prepare( sysContext, fuData );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_FieldUpgradeData_Complete( sysContext, nextDigest, firstDigest );
        }
    }
    
    return rval;
}
コード例 #4
0
TPM_RC Tss2_Sys_VerifySignature(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	keyHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_DIGEST	*digest,
    TPMT_SIGNATURE	*signature,
    TPMT_TK_VERIFIED	*validation,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_VerifySignature_Prepare( sysContext, keyHandle, digest, signature );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_VerifySignature_Complete( sysContext, validation );
        }
    }
    
    return rval;
}
コード例 #5
0
TPM_RC Tss2_Sys_EC_Ephemeral(
    TSS2_SYS_CONTEXT *sysContext,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPMI_ECC_CURVE	curveID,
    TPM2B_ECC_POINT	*Q,
    UINT16	*counter,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

     

    rval = Tss2_Sys_EC_Ephemeral_Prepare( sysContext, curveID );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_EC_Ephemeral_Complete( sysContext, Q, counter );
        }
    }
    
    return rval;
}
コード例 #6
0
TPM_RC Tss2_Sys_MakeCredential(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	handle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_DIGEST	*credential,
    TPM2B_NAME	*objectName,
    TPM2B_ID_OBJECT	*credentialBlob,
    TPM2B_ENCRYPTED_SECRET	*secret,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

     

    rval = Tss2_Sys_MakeCredential_Prepare( sysContext, handle, credential, objectName );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_MakeCredential_Complete( sysContext, credentialBlob, secret );
        }
    }
    
    return rval;
}
コード例 #7
0
ファイル: Tss2_Sys_Load.c プロジェクト: alex1818/TPM2.0-TSS
TPM_RC Tss2_Sys_Load(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	parentHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_PRIVATE	*inPrivate,
    TPM2B_PUBLIC	*inPublic,
    TPM_HANDLE	*objectHandle,
    TPM2B_NAME	*name,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

     

    rval = Tss2_Sys_Load_Prepare( sysContext, parentHandle, inPrivate, inPublic );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_Load_Complete( sysContext, objectHandle, name );
        }
    }
    
    return rval;
}
コード例 #8
0
TPM_RC Tss2_Sys_GetCapability(
    TSS2_SYS_CONTEXT *sysContext,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM_CAP	capability,
    UINT32	property,
    UINT32	propertyCount,
    TPMI_YES_NO	*moreData,
    TPMS_CAPABILITY_DATA	*capabilityData,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;



    rval = Tss2_Sys_GetCapability_Prepare( sysContext, capability, property, propertyCount );

    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_GetCapability_Complete( sysContext, moreData, capabilityData );
        }
    }

    return rval;
}
コード例 #9
0
TPM_RC Tss2_Sys_SequenceComplete(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	sequenceHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_MAX_BUFFER	*buffer,
    TPMI_RH_HIERARCHY	hierarchy,
    TPM2B_DIGEST	*result,
    TPMT_TK_HASHCHECK	*validation,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_SequenceComplete_Prepare( sysContext, sequenceHandle, buffer, hierarchy );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_SequenceComplete_Complete( sysContext, result, validation );
        }
    }
    
    return rval;
}
コード例 #10
0
ファイル: Tss2_Sys_Rewrap.c プロジェクト: zweib730/TPM2.0-TSS
TPM_RC Tss2_Sys_Rewrap(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	oldParent,
    TPMI_DH_OBJECT	newParent,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_PRIVATE	*inDuplicate,
    TPM2B_NAME	*name,
    TPM2B_ENCRYPTED_SECRET	*inSymSeed,
    TPM2B_PRIVATE	*outDuplicate,
    TPM2B_ENCRYPTED_SECRET	*outSymSeed,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

     

    rval = Tss2_Sys_Rewrap_Prepare( sysContext, oldParent, newParent, inDuplicate, name, inSymSeed );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_Rewrap_Complete( sysContext, outDuplicate, outSymSeed );
        }
    }
    
    return rval;
}
コード例 #11
0
ファイル: Tss2_Sys_HMAC.c プロジェクト: zweib730/TPM2.0-TSS
TPM_RC Tss2_Sys_HMAC(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	handle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_MAX_BUFFER	*buffer,
    TPMI_ALG_HASH	hashAlg,
    TPM2B_DIGEST	*outHMAC,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

     

    rval = Tss2_Sys_HMAC_Prepare( sysContext, handle, buffer, hashAlg );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_HMAC_Complete( sysContext, outHMAC );
        }
    }
    
    return rval;
}
コード例 #12
0
TPM_RC Tss2_Sys_RSA_Encrypt(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	keyHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_PUBLIC_KEY_RSA	*message,
    TPMT_RSA_DECRYPT	*inScheme,
    TPM2B_DATA	*label,
    TPM2B_PUBLIC_KEY_RSA	*outData,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_RSA_Encrypt_Prepare( sysContext, keyHandle, message, inScheme, label );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_RSA_Encrypt_Complete( sysContext, outData );
        }
    }
    
    return rval;
}
コード例 #13
0
ファイル: Tss2_Sys_GetRandom.c プロジェクト: 01org/TPM2.0-TSS
TPM_RC Tss2_Sys_GetRandom(
    TSS2_SYS_CONTEXT *sysContext,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    UINT16	bytesRequested,
    TPM2B_DIGEST	*randomBytes,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;



    rval = Tss2_Sys_GetRandom_Prepare( sysContext, bytesRequested );

    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_GetRandom_Complete( sysContext, randomBytes );
        }
    }

    return rval;
}
コード例 #14
0
TPM_RC Tss2_Sys_CertifyCreation(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	signHandle,
    TPMI_DH_OBJECT	objectHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_DATA	*qualifyingData,
    TPM2B_DIGEST	*creationHash,
    TPMT_SIG_SCHEME	*inScheme,
    TPMT_TK_CREATION	*creationTicket,
    TPM2B_ATTEST	*certifyInfo,
    TPMT_SIGNATURE	*signature,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( inScheme == NULL  || creationTicket == NULL  )
	{
		return TSS2_SYS_RC_BAD_REFERENCE;
	}

    rval = Tss2_Sys_CertifyCreation_Prepare( sysContext, signHandle, objectHandle, qualifyingData, creationHash, inScheme, creationTicket );

    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_CertifyCreation_Complete( sysContext, certifyInfo, signature );
        }
    }

    return rval;
}
コード例 #15
0
TPM_RC Tss2_Sys_GetTestResult(
    TSS2_SYS_CONTEXT *sysContext,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_MAX_BUFFER	*outData,
    TPM_RC	*testResult,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;



    rval = Tss2_Sys_GetTestResult_Prepare( sysContext );

    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_GetTestResult_Complete( sysContext, outData, testResult );
        }
    }

    return rval;
}
コード例 #16
0
TPM_RC Tss2_Sys_ZGen_2Phase(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	keyA,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_ECC_POINT	*inQsB,
    TPM2B_ECC_POINT	*inQeB,
    TPMI_ECC_KEY_EXCHANGE	inScheme,
    UINT16	counter,
    TPM2B_ECC_POINT	*outZ1,
    TPM2B_ECC_POINT	*outZ2,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_ZGen_2Phase_Prepare( sysContext, keyA, inQsB, inQeB, inScheme, counter );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_ZGen_2Phase_Complete( sysContext, outZ1, outZ2 );
        }
    }
    
    return rval;
}
コード例 #17
0
TPM_RC Tss2_Sys_GetCommandAuditDigest(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_RH_ENDORSEMENT	privacyHandle,
    TPMI_DH_OBJECT	signHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_DATA	*qualifyingData,
    TPMT_SIG_SCHEME	*inScheme,
    TPM2B_ATTEST	*auditInfo,
    TPMT_SIGNATURE	*signature,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_GetCommandAuditDigest_Prepare( sysContext, privacyHandle, signHandle, qualifyingData, inScheme );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_GetCommandAuditDigest_Complete( sysContext, auditInfo, signature );
        }
    }
    
    return rval;
}
コード例 #18
0
TPM_RC Tss2_Sys_ECDH_KeyGen(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	keyHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_ECC_POINT	*zPoint,
    TPM2B_ECC_POINT	*pubPoint,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

     

    rval = Tss2_Sys_ECDH_KeyGen_Prepare( sysContext, keyHandle );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_ECDH_KeyGen_Complete( sysContext, zPoint, pubPoint );
        }
    }
    
    return rval;
}
コード例 #19
0
TPM_RC Tss2_Sys_NV_ReadPublic(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_RH_NV_INDEX	nvIndex,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_NV_PUBLIC	*nvPublic,
    TPM2B_NAME	*nvName,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_NV_ReadPublic_Prepare( sysContext, nvIndex );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_NV_ReadPublic_Complete( sysContext, nvPublic, nvName );
        }
    }
    
    return rval;
}
コード例 #20
0
TPM_RC Tss2_Sys_ContextLoad(
    TSS2_SYS_CONTEXT *sysContext,
    TPMS_CONTEXT	*context,
    TPMI_DH_CONTEXT	*loadedHandle
)
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( context == NULL  )
    {
        return TSS2_SYS_RC_BAD_REFERENCE;
    }

    rval = Tss2_Sys_ContextLoad_Prepare( sysContext, context );

    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, 0, 0 );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_ContextLoad_Complete( sysContext, loadedHandle );
        }
    }

    return rval;
}
コード例 #21
0
TPM_RC Tss2_Sys_ContextSave(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_CONTEXT	saveHandle,
    TPMS_CONTEXT	*context
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_ContextSave_Prepare( sysContext, saveHandle );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, 0, 0 );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_ContextSave_Complete( sysContext, context );
        }
    }
    
    return rval;
}
コード例 #22
0
ファイル: Tss2_Sys_Import.c プロジェクト: dandantx/TPM2.0-TSS
TPM_RC Tss2_Sys_Import(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	parentHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_DATA	*encryptionKey,
    TPM2B_PUBLIC	*objectPublic,
    TPM2B_PRIVATE	*duplicate,
    TPM2B_ENCRYPTED_SECRET	*inSymSeed,
    TPMT_SYM_DEF_OBJECT	*symmetricAlg,
    TPM2B_PRIVATE	*outPrivate,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_Import_Prepare( sysContext, parentHandle, encryptionKey, objectPublic, duplicate, inSymSeed, symmetricAlg );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_Import_Complete( sysContext, outPrivate );
        }
    }
    
    return rval;
}
コード例 #23
0
TPM_RC Tss2_Sys_PCR_Allocate(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_RH_PLATFORM	authHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPML_PCR_SELECTION	*pcrAllocation,
    TPMI_YES_NO	*allocationSuccess,
    UINT32	*maxPCR,
    UINT32	*sizeNeeded,
    UINT32	*sizeAvailable,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_PCR_Allocate_Prepare( sysContext, authHandle, pcrAllocation );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_PCR_Allocate_Complete( sysContext, allocationSuccess, maxPCR, sizeNeeded, sizeAvailable );
        }
    }
    
    return rval;
}
コード例 #24
0
TPM_RC Tss2_Sys_EncryptDecrypt(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	keyHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPMI_YES_NO	decrypt,
    TPMI_ALG_SYM_MODE	mode,
    TPM2B_IV	*ivIn,
    TPM2B_MAX_BUFFER	*inData,
    TPM2B_MAX_BUFFER	*outData,
    TPM2B_IV	*ivOut,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;



    rval = Tss2_Sys_EncryptDecrypt_Prepare( sysContext, keyHandle, decrypt, mode, ivIn, inData );

    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_EncryptDecrypt_Complete( sysContext, outData, ivOut );
        }
    }

    return rval;
}
コード例 #25
0
ファイル: Tss2_Sys_Hash.c プロジェクト: 01org/TPM2.0-TSS
TPM_RC Tss2_Sys_Hash(
    TSS2_SYS_CONTEXT *sysContext,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_MAX_BUFFER	*data,
    TPMI_ALG_HASH	hashAlg,
    TPMI_RH_HIERARCHY	hierarchy,
    TPM2B_DIGEST	*outHash,
    TPMT_TK_HASHCHECK	*validation,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;



    rval = Tss2_Sys_Hash_Prepare( sysContext, data, hashAlg, hierarchy );

    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_Hash_Complete( sysContext, outHash, validation );
        }
    }

    return rval;
}
コード例 #26
0
TPM_RC Tss2_Sys_ECC_Parameters(
    TSS2_SYS_CONTEXT *sysContext,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPMI_ECC_CURVE	curveID,
    TPMS_ALGORITHM_DETAIL_ECC	*parameters,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_ECC_Parameters_Prepare( sysContext, curveID );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_ECC_Parameters_Complete( sysContext, parameters );
        }
    }
    
    return rval;
}
コード例 #27
0
TPM_RC Tss2_Sys_IncrementalSelfTest(
    TSS2_SYS_CONTEXT *sysContext,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPML_ALG	*toTest,
    TPML_ALG	*toDoList,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( toTest == NULL  )
	{
		return TSS2_SYS_RC_BAD_REFERENCE;
	} 

    rval = Tss2_Sys_IncrementalSelfTest_Prepare( sysContext, toTest );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_IncrementalSelfTest_Complete( sysContext, toDoList );
        }
    }
    
    return rval;
}
コード例 #28
0
TPM_RC Tss2_Sys_HashSequenceStart(
    TSS2_SYS_CONTEXT *sysContext,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_AUTH	*auth,
    TPMI_ALG_HASH	hashAlg,
    TPMI_DH_OBJECT	*sequenceHandle,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_HashSequenceStart_Prepare( sysContext, auth, hashAlg );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_HashSequenceStart_Complete( sysContext, sequenceHandle );
        }
    }
    
    return rval;
}
コード例 #29
0
TPM_RC Tss2_Sys_EventSequenceComplete(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_PCR	pcrHandle,
    TPMI_DH_OBJECT	sequenceHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_MAX_BUFFER	*buffer,
    TPML_DIGEST_VALUES	*results,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

     

    rval = Tss2_Sys_EventSequenceComplete_Prepare( sysContext, pcrHandle, sequenceHandle, buffer );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_EventSequenceComplete_Complete( sysContext, results );
        }
    }
    
    return rval;
}
コード例 #30
0
ファイル: Tss2_Sys_Duplicate.c プロジェクト: KunYi/TPM2.0-TSS
TPM_RC Tss2_Sys_Duplicate(
    TSS2_SYS_CONTEXT *sysContext,
    TPMI_DH_OBJECT	objectHandle,
    TPMI_DH_OBJECT	newParentHandle,
    TSS2_SYS_CMD_AUTHS const *cmdAuthsArray,
    TPM2B_DATA	*encryptionKeyIn,
    TPMT_SYM_DEF_OBJECT	*symmetricAlg,
    TPM2B_DATA	*encryptionKeyOut,
    TPM2B_PRIVATE	*duplicate,
    TPM2B_ENCRYPTED_SECRET	*outSymSeed,
    TSS2_SYS_RSP_AUTHS *rspAuthsArray
    )
{
    TSS2_RC     rval = TPM_RC_SUCCESS;

    if( sysContext == NULL )
    {
        return( TSS2_SYS_RC_BAD_REFERENCE );
    }

    rval = Tss2_Sys_Duplicate_Prepare( sysContext, objectHandle, newParentHandle, encryptionKeyIn, symmetricAlg );
    
    if( rval == TSS2_RC_SUCCESS )
    {
        rval = CommonOneCall( sysContext, cmdAuthsArray, rspAuthsArray );

        if( rval == TSS2_RC_SUCCESS )
        {
            rval = Tss2_Sys_Duplicate_Complete( sysContext, encryptionKeyOut, duplicate, outSymSeed );
        }
    }
    
    return rval;
}