/* */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
-/* $Id: Simulator_fp.h 1519 2019-11-15 20:43:51Z kgoldman $ */
+/* $Id: Simulator_fp.h 1658 2021-01-22 23:14:01Z kgoldman $ */
/* */
/* Licenses and Notices */
/* */
/* arising in any way out of use or reliance upon this specification or any */
/* information herein. */
/* */
-/* (c) Copyright IBM Corp. and others, 2016 - 2019 */
+/* (c) Copyright IBM Corp. and others, 2016 - 2021 */
/* */
/********************************************************************************/
#ifndef _SIMULATOR_FP_H_
#define _SIMULATOR_FP_H_
-#include "BaseTypes.h"
+#include <stdbool.h>
#ifdef TPM_WINDOWS
#include <windows.h>
handler. */
void
_rpc__Signal_PowerOn(
- BOOL isReset
+ bool isReset
);
/* D.2.2.2. Signal_Restart() */
/* This function processes the clock restart indication. All it does is call the platform
int state
);
/* D.4.2.15. _rpc__ACT_GetSignaled() */
-BOOL
+bool
_rpc__ACT_GetSignaled(
- UINT32 actHandle
+ uint32_t actHandle
);
/* D.2.3. From TPMCmds.c */
#endif /* libtpms added */
/* libtpms added begin */
void _rpc__Signal_SetTPMEstablished(void);
-BOOL _rpc__Signal_GetTPMEstablished(void);
+bool _rpc__Signal_GetTPMEstablished(void);
void _rpc__Signal_ResetTPMEstablished(void);
-BOOL _rpc__Signal_IsPowerOn(void);
+bool _rpc__Signal_IsPowerOn(void);
/* libtpms added end */
#endif // _SIMULATOR_FP_H_
/* Process the commands */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
-/* $Id: TPMCmdp.c 1594 2020-03-26 22:15:48Z kgoldman $ */
+/* $Id: TPMCmdp.c 1658 2021-01-22 23:14:01Z kgoldman $ */
/* */
/* Licenses and Notices */
/* */
/* arising in any way out of use or reliance upon this specification or any */
/* information herein. */
/* */
-/* (c) Copyright IBM Corp. and others, 2016 - 2020 */
+/* (c) Copyright IBM Corp. and others, 2016 - 2021 */
/* */
/********************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <setjmp.h>
+#include <stdbool.h>
#include "TpmBuildSwitches.h"
#ifdef TPM_WINDOWS
#include <windows.h>
#endif
#include "TpmProfile.h" /* kgold */
-static BOOL s_isPowerOn = FALSE;
+static bool s_isPowerOn = false;
/* D.4.3. Functions */
/* D.4.3.1. Signal_PowerOn() */
/* This function processes a power-on indication. Among other things, it calls the _TPM_Init()
handler. */
void
_rpc__Signal_PowerOn(
- BOOL isReset
+ bool isReset
)
{
// if power is on and this is not a call to do TPM reset then return
// Power on and reset both lead to _TPM_Init()
_plat__Signal_Reset();
// Set state as power on
- s_isPowerOn = TRUE;
+ s_isPowerOn = true;
}
#if 0 /* libtpms added */
/* D.4.3.2. Signal_Restart() */
// Pass power off signal to platform
_plat__Signal_PowerOff();
// This could be redundant, but...
- s_isPowerOn = FALSE;
+ s_isPowerOn = false;
return;
}
#if 0 /* libtpms added */
/* D.4.2.15. _rpc__ACT_GetSignaled() */
/* This function is used to count the ACT second tick. */
-BOOL
+bool
_rpc__ACT_GetSignaled(
- UINT32 actHandle
+ uint32_t actHandle
)
{
// If TPM power is on
if (s_isPowerOn)
// Query the platform
return _plat__ACT_GetSignaled(actHandle - TPM_RH_ACT_0);
- return FALSE;
+ return false;
}
#endif /* libtpms added */
/* libtpms added begin */
-static BOOL tpmEstablished;
+static bool tpmEstablished;
void
_rpc__Signal_SetTPMEstablished(void)
tpmEstablished = FALSE;
}
-BOOL
+bool
_rpc__Signal_GetTPMEstablished(void)
{
return tpmEstablished;
}
-BOOL
+bool
_rpc__Signal_IsPowerOn(void)
{
return s_isPowerOn;
/* Socket Interface to a TPM Simulator */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
-/* $Id: TcpServerPosix_fp.h 1528 2019-11-20 20:31:43Z kgoldman $ */
+/* $Id: TcpServerPosix_fp.h 1658 2021-01-22 23:14:01Z kgoldman $ */
/* */
/* Licenses and Notices */
/* */
/* arising in any way out of use or reliance upon this specification or any */
/* information herein. */
/* */
-/* (c) Copyright IBM Corp. and others, 2016 - 2019 */
+/* (c) Copyright IBM Corp. and others, 2016 - 2021 */
/* */
/********************************************************************************/
#include "CompilerDependencies.h"
#include "BaseTypes.h"
-BOOL
+bool
PlatformServer(
SOCKET s
);
int *PortNumber,
int *PortNumberPlatform
);
-BOOL
+bool
ReadBytes(
SOCKET s,
char *buffer,
int NumBytes
);
-BOOL
+bool
WriteBytes(
SOCKET s,
char *buffer,
int NumBytes
);
-BOOL
+bool
WriteUINT32(
SOCKET s,
UINT32 val
);
-BOOL
+bool
ReadVarBytes(
SOCKET s,
char *buffer,
UINT32 *BytesReceived,
int MaxLen
);
-BOOL
+bool
WriteVarBytes(
SOCKET s,
char *buffer,
int BytesToSend
);
-BOOL
+bool
TpmServer(
SOCKET s
);