Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions tests/nvram_offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ int main(void)
return EXIT_FAILURE;
}

/*
* OBJECTs are directly written into NVRAM. We have to make sure that the
* size of the OBJECT is the same on all architectures so that a full
* NVRAM fits on all architectures
*/
#if defined(__x86_64__)
/* Leave this check on x86_64 for 'notification' when sizeof(OBJECT) increases */
#if RSA_16384
# error Unsupported RSA key size
#elif RSA_4096
Expand All @@ -60,6 +57,7 @@ int main(void)
sizeof(privateExponent_t));
return EXIT_FAILURE;
}
#endif /* __x86_64__ */

/* Same for NV_INDEX */
#define NV_INDEX_EXP_SIZE 148
Expand Down
9 changes: 6 additions & 3 deletions tests/object_size.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,19 @@ int main(void)
.seedCompatLevel = 1,
};
#pragma GCC diagnostics pop
static const size_t exp_sizes[7] = {
0, 3284, 3284, 3284, 3284, 3284, 3288,
static const size_t exp_sizes[9] = {
/* SFL: 0 .. 5 */ 0 , 3284, 3284, 3284, 3284, 3284,
/* SFL: 6 .. 8 */ 3288, 3288, 3288,
};
BYTE buffer[2 * MAX_MARSHALLED_OBJECT_SIZE];
UINT32 stateFormatLevel;
UINT32 written;
INT32 size;
BYTE *buf;

for (stateFormatLevel = 1; stateFormatLevel <= 6; stateFormatLevel++) {
for (stateFormatLevel = 1;
stateFormatLevel < ARRAY_SIZE(exp_sizes);
stateFormatLevel++) {
/* this buffer must only be filled to <= MAX_MARSHALLED_OBJECT_SIZE bytes */
buf = buffer;
size = sizeof(buffer);
Expand Down