• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stefanberger / libtpms / #2015

05 Aug 2025 12:00AM UTC coverage: 77.231% (+0.4%) from 76.783%
#2015

push

travis-ci

web-flow
Merge 3cee57d10 into c0a2f2222

36108 of 46753 relevant lines covered (77.23%)

122677.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/disabled_interface.c
1
#include <stddef.h>
2
#include "tpm_error.h"
3
#include "tpm_library_intern.h"
4

5
static TPM_RESULT Disabled_MainInit(void)
6
{
7
    return TPM_FAIL;
×
8
}
9

10
static void Disabled_Terminate(void)
11
{
12
}
13

14
static TPM_RESULT
15
Disabled_Process(unsigned char **respbuffer LIBTPMS_ATTR_UNUSED,
×
16
                 uint32_t *resp_size LIBTPMS_ATTR_UNUSED,
17
                 uint32_t *respbufsize LIBTPMS_ATTR_UNUSED,
18
                 unsigned char *command LIBTPMS_ATTR_UNUSED,
19
                 uint32_t command_size LIBTPMS_ATTR_UNUSED)
20
{
21
    return TPM_FAIL;
×
22
}
23

24
static TPM_RESULT
25
Disabled_VolatileAllStore(unsigned char **buffer LIBTPMS_ATTR_UNUSED,
×
26
                          uint32_t *buflen LIBTPMS_ATTR_UNUSED)
27
{
28
    return TPM_FAIL;
×
29
}
30

31
static TPM_RESULT Disabled_CancelCommand(void)
32
{
33
    return TPM_FAIL;
×
34
}
35

36
static TPM_RESULT
37
Disabled_GetTPMProperty(enum TPMLIB_TPMProperty prop LIBTPMS_ATTR_UNUSED,
×
38
                        int *result LIBTPMS_ATTR_UNUSED)
39
{
40
    return TPM_FAIL;
×
41
}
42

43
static char *
44
Disabled_GetInfo(enum TPMLIB_InfoFlags flags LIBTPMS_ATTR_UNUSED)
×
45
{
46
    return NULL;
×
47
}
48

49
static uint32_t
50
Disabled_SetBufferSize(uint32_t wanted_size LIBTPMS_ATTR_UNUSED,
×
51
                       uint32_t *min_size LIBTPMS_ATTR_UNUSED,
52
                       uint32_t *max_size LIBTPMS_ATTR_UNUSED)
53
{
54
    return 0;
×
55
}
56

57
static TPM_RESULT
58
Disabled_ValidateState(enum TPMLIB_StateType st LIBTPMS_ATTR_UNUSED,
×
59
                       unsigned int flags LIBTPMS_ATTR_UNUSED)
60
{
61
    return TPM_FAIL;
×
62
}
63

64
static TPM_RESULT
65
Disabled_GetState(enum TPMLIB_StateType st LIBTPMS_ATTR_UNUSED,
×
66
                  unsigned char **buffer LIBTPMS_ATTR_UNUSED,
67
                  uint32_t *buflen LIBTPMS_ATTR_UNUSED)
68
{
69
    return TPM_FAIL;
×
70
}
71

72
static TPM_RESULT
73
Disabled_SetState(enum TPMLIB_StateType st LIBTPMS_ATTR_UNUSED,
×
74
                  const unsigned char *buffer LIBTPMS_ATTR_UNUSED,
75
                  uint32_t buflen LIBTPMS_ATTR_UNUSED)
76
{
77
    return TPM_FAIL;
×
78
}
79

80
static TPM_RESULT Disabled_IO_Hash_Start(void)
81
{
82
    return TPM_FAIL;
×
83
}
84

85
static TPM_RESULT
86
Disabled_IO_Hash_Data(const unsigned char *data LIBTPMS_ATTR_UNUSED,
×
87
                      uint32_t data_length LIBTPMS_ATTR_UNUSED)
88
{
89
    return TPM_FAIL;
×
90
}
91

92
static TPM_RESULT Disabled_IO_Hash_End(void)
93
{
94
    return TPM_FAIL;
×
95
}
96

97
static TPM_RESULT
98
Disabled_IO_TpmEstablished_Get(TPM_BOOL *tpmEstablished LIBTPMS_ATTR_UNUSED)
×
99
{
100
    return TPM_FAIL;
×
101
}
102

103
static TPM_RESULT Disabled_IO_TpmEstablished_Reset(void)
104
{
105
    return TPM_FAIL;
×
106
}
107

108
static TPM_BOOL Disabled_WasManufactured(void)
109
{
110
    return FALSE;
×
111
}
112

113
const struct tpm_interface DisabledInterface = {
114
    .MainInit = Disabled_MainInit,
115
    .Terminate = Disabled_Terminate,
116
    .Process = Disabled_Process,
117
    .VolatileAllStore = Disabled_VolatileAllStore,
118
    .CancelCommand = Disabled_CancelCommand,
119
    .GetTPMProperty = Disabled_GetTPMProperty,
120
    .GetInfo = Disabled_GetInfo,
121
    .TpmEstablishedGet = Disabled_IO_TpmEstablished_Get,
122
    .TpmEstablishedReset = Disabled_IO_TpmEstablished_Reset,
123
    .HashStart = Disabled_IO_Hash_Start,
124
    .HashData = Disabled_IO_Hash_Data,
125
    .HashEnd = Disabled_IO_Hash_End,
126
    .SetBufferSize = Disabled_SetBufferSize,
127
    .ValidateState = Disabled_ValidateState,
128
    .SetState = Disabled_SetState,
129
    .GetState = Disabled_GetState,
130
    .WasManufactured = Disabled_WasManufactured,
131
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc