Compare commits

..

6 Commits

Author SHA1 Message Date
Stefan Berger
80c3352bc7 tpm2: Add or remove empty lines to reduce diffs
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2025-08-04 20:27:44 -04:00
Stefan Berger
d3e9240e84 tpm2: Remove commented-out blocks
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2025-08-04 20:17:26 -04:00
Stefan Berger
7b37afc1d2 tpm2: Sync defines for unsupported AC_GetCapability
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2025-08-04 20:03:24 -04:00
Stefan Berger
bc565b962f tpm2: Add definitions for new algorithms and curves
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2025-08-04 20:03:24 -04:00
Stefan Berger
e28feca41f tpm2: Sync with new defines on symmetric algorithms' sizes
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2025-08-04 20:03:24 -04:00
Stefan Berger
e5d27e9011 tpm2: Move defines for commands from TpmAlgorithmDefines to TpmTypes.h
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2025-08-04 20:03:24 -04:00
13 changed files with 13 additions and 84 deletions

View File

@ -5059,41 +5059,6 @@ SetCapability_COMMAND_DESCRIPTOR_t _SetCapabilityData = {
#define _SetCapabilityDataAddress 0 #define _SetCapabilityDataAddress 0
#endif // CC_SetCapability #endif // CC_SetCapability
#if CC_AC_GetCapability
#include "AC_GetCapability_fp.h"
typedef TPM_RC (AC_GetCapability_Entry)(
AC_GetCapability_In *in,
AC_GetCapability_Out *out
);
typedef const struct {
AC_GetCapability_Entry *entry;
UINT16 inSize;
UINT16 outSize;
UINT16 offsetOfTypes;
UINT16 paramOffsets[3];
BYTE types[7];
} AC_GetCapability_COMMAND_DESCRIPTOR_t;
AC_GetCapability_COMMAND_DESCRIPTOR_t _AC_GetCapabilityData = {
/* entry */ &TPM2_AC_GetCapability,
/* inSize */ (UINT16)(sizeof(AC_GetCapability_In)),
/* outSize */ (UINT16)(sizeof(AC_GetCapability_Out)),
/* offsetOfTypes */ offsetof(AC_GetCapability_COMMAND_DESCRIPTOR_t, types),
/* offsets */ {(UINT16)(offsetof(AC_GetCapability_In, capability)),
(UINT16)(offsetof(AC_GetCapability_In, count)),
(UINT16)(offsetof(AC_GetCapability_Out, capabilitiesData))},
/* types */ {TPMI_RH_AC_H_UNMARSHAL,
TPM_AT_P_UNMARSHAL,
UINT32_P_UNMARSHAL,
END_OF_LIST,
TPMI_YES_NO_P_MARSHAL,
TPML_AC_CAPABILITIES_P_MARSHAL,
END_OF_LIST}
};
#define _AC_GetCapabilityDataAddress (&_AC_GetCapabilityData)
#else
#define _AC_GetCapabilityDataAddress 0
#endif
#if CC_AC_Send #if CC_AC_Send
#include "AC_Send_fp.h" #include "AC_Send_fp.h"
@ -5618,7 +5583,7 @@ COMMAND_DESCRIPTOR_t* s_CommandDataArray[] = {
(COMMAND_DESCRIPTOR_t*)_EncryptDecrypt2DataAddress, (COMMAND_DESCRIPTOR_t*)_EncryptDecrypt2DataAddress,
#endif // CC_EncryptDecrypt2 #endif // CC_EncryptDecrypt2
#if (PAD_LIST || CC_AC_GetCapability) #if (PAD_LIST || CC_AC_GetCapability)
(COMMAND_DESCRIPTOR_t*)_AC_GetCapabilityDataAddress, (COMMAND_DESCRIPTOR_t*)_GetCapabilityDataAddress,
#endif // CC_AC_GetCapability #endif // CC_AC_GetCapability
#if (PAD_LIST || CC_AC_Send) #if (PAD_LIST || CC_AC_Send)
(COMMAND_DESCRIPTOR_t*)_AC_SendDataAddress, (COMMAND_DESCRIPTOR_t*)_AC_SendDataAddress,

View File

@ -59,6 +59,7 @@
/* */ /* */
/********************************************************************************/ /********************************************************************************/
//* Includes and Typedefs //* Includes and Typedefs
#include "Tpm.h" #include "Tpm.h"
#include "Marshal.h" #include "Marshal.h"

View File

@ -58,6 +58,7 @@
/* */ /* */
/********************************************************************************/ /********************************************************************************/
//** Description //** Description
// This file contains internal global type definitions and data declarations that // This file contains internal global type definitions and data declarations that

View File

@ -154,9 +154,7 @@ TPM2B_EMPTY c_SHA3_384_digest = {{0, {0}}};
TPM2B_EMPTY c_SHA3_512_digest = {{0, {0}}}; TPM2B_EMPTY c_SHA3_512_digest = {{0, {0}}};
#endif #endif
#if SMAC_IMPLEMENTED && ALG_CMAC // libtpms added begin
// libtpms added begin
#if SMAC_IMPLEMENTED && ALG_CMAC
TPM2B_TYPE(AES128, 16); TPM2B_TYPE(AES128, 16);
static TPM2B_AES128 cmac_aeskey = {{16, { static TPM2B_AES128 cmac_aeskey = {{16, {
0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
@ -213,6 +211,5 @@ static const struct CMACTest {
.key = NULL, .key = NULL,
} }
}; };
#endif #endif // libtpms added end
// libtpms added end

View File

@ -58,6 +58,7 @@
/* */ /* */
/********************************************************************************/ /********************************************************************************/
#ifndef _MANUFACTURE_FP_H_ #ifndef _MANUFACTURE_FP_H_
#define _MANUFACTURE_FP_H_ #define _MANUFACTURE_FP_H_

View File

@ -333,46 +333,3 @@ bool _rpc__Signal_IsPowerOn(void)
} }
/* libtpms added end */ /* libtpms added end */
#if 0
/* D.4 TPMCmdp.c */
/* D.4.1. Description */
/* This file contains the functions that process the commands received on the control port or the
command port of the simulator. The control port is used to allow simulation of hardware events
(such as, _TPM_Hash_Start()) to test the simulated TPM's reaction to those events. This improves
code coverage of the testing. */
/* D.4.2. Includes and Data Definitions */
#include <stdlib.h>
#include <stdio.h>
#include <setjmp.h>
#include <stdbool.h>
#include "TpmBuildSwitches.h"
#ifdef TPM_WINDOWS
#include <windows.h>
#include <winsock.h>
#endif
//#include "Platform_fp.h"
#include "PlatformACT_fp.h"
#include "ExecCommand_fp.h"
#include "Manufacture_fp.h"
#include "_TPM_Init_fp.h"
#include "_TPM_Hash_Start_fp.h"
#include "_TPM_Hash_Data_fp.h"
#include "_TPM_Hash_End_fp.h"
#include "TpmFail_fp.h"
#include "TpmTcpProtocol.h"
#include "Simulator_fp.h"
#ifdef TPM_WINDOWS
#include "TcpServer_fp.h" /* kgold */
#endif
#ifdef TPM_POSIX
#include "TcpServerPosix_fp.h" /* kgold */
#endif
#include "TpmProfile.h" /* kgold */
#define TPM_RH_ACT_0 0x40000110
#endif

View File

@ -58,6 +58,7 @@
/* */ /* */
/********************************************************************************/ /********************************************************************************/
// FILE GENERATED BY TpmExtractCode: DO NOT EDIT // FILE GENERATED BY TpmExtractCode: DO NOT EDIT
#ifndef _TPM_INCLUDE_PRIVATE_TPMALGORITHMDEFINES_H_ #ifndef _TPM_INCLUDE_PRIVATE_TPMALGORITHMDEFINES_H_

View File

@ -58,6 +58,7 @@
/* */ /* */
/********************************************************************************/ /********************************************************************************/
// this file defines the desired command list that should be built into the // this file defines the desired command list that should be built into the
// Tpm Core Lib. // Tpm Core Lib.

View File

@ -58,6 +58,7 @@
/* */ /* */
/********************************************************************************/ /********************************************************************************/
// clang-format off // clang-format off
// clang-format off to preserve define alignment breaking sections. // clang-format off to preserve define alignment breaking sections.

View File

@ -58,6 +58,7 @@
/* */ /* */
/********************************************************************************/ /********************************************************************************/
// FILE GENERATED BY TpmExtractCode: DO NOT EDIT // FILE GENERATED BY TpmExtractCode: DO NOT EDIT
#ifndef _TPM_INCLUDE_PRIVATE_TPMTYPES_H_ #ifndef _TPM_INCLUDE_PRIVATE_TPMTYPES_H_

View File

@ -58,6 +58,7 @@
/* */ /* */
/********************************************************************************/ /********************************************************************************/
#ifndef _VENDORINFO_H #ifndef _VENDORINFO_H
#define _VENDORINFO_H #define _VENDORINFO_H

View File

@ -58,6 +58,7 @@
/* */ /* */
/********************************************************************************/ /********************************************************************************/
// common headers for simulator implementation files // common headers for simulator implementation files
#ifndef SIMULATOR_PRIVATE_H #ifndef SIMULATOR_PRIVATE_H

View File

@ -58,6 +58,7 @@
/* */ /* */
/********************************************************************************/ /********************************************************************************/
// This file represents the functional interface that all platform libraries must // This file represents the functional interface that all platform libraries must
// provide because they are called by the Core TPM library. // provide because they are called by the Core TPM library.
#ifndef _TPM_TO_PLATFORM_INTERFACE_H_ #ifndef _TPM_TO_PLATFORM_INTERFACE_H_