All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [tpm2] Error running tpm2_create: magic does not match!
@ 2019-10-01 18:50 Arun Sudhir
  0 siblings, 0 replies; only message in thread
From: Arun Sudhir @ 2019-10-01 18:50 UTC (permalink / raw
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 1185 bytes --]

I hve ported tpm2_tools to windows and and am able to run tpm2_getrandom,
tpm2_createprimary etc. I am using the ctx file generated by
tpm2_createprimary to run tpm2_create.

HEre are the commands i used:

tpm2_createprimary -c primary.ctx (works)tpm2_create -C primary.ctx -u
obj.pub -r obj.priv (fails)



This is the error i get:

ERROR: Found magic 0x40000001 did not match expected magic of 0xbadcc0de!
WARN: The loaded tpm context does not appear to be in the proper format,
assuming old format, this will be converted on the next save.
ERROR: Could not load tpm context file
ERROR: Failed to load_tpm_context_file()
ERROR: Unable to run
C:\Users\arunsu\source\repos\tpm2-tools-4.0\vstudio\x64\Debug\tpm2-create.exe


I see from files.c that the magic is hardcoded.
/**
 * This is the magic for the file header. The header is organized
 * as a big endian U32 (BEU32) of MAGIC followed by a BEU32 of the
 * version number. Tools can define their own, individual file
 * formats as they make sense, but they should always have the header.
 */
static const UINT32 MAGIC = 0xBADCC0DE;
Is this a windows vs Linux issue? Should i change the magic value?

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 2329 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-10-01 18:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-01 18:50 [tpm2] Error running tpm2_create: magic does not match! Arun Sudhir

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.