All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Sudhir <arunsudhir19 at gmail.com>
To: tpm2@lists.01.org
Subject: [tpm2] Error running tpm2_create: magic does not match!
Date: Tue, 01 Oct 2019 11:50:15 -0700	[thread overview]
Message-ID: <CAJLNp_XZ0UonxQane-no3GVCzGq4X-X7p9Y0_fva5qZO9bOrVg@mail.gmail.com> (raw)

[-- 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 --]

                 reply	other threads:[~2019-10-01 18:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJLNp_XZ0UonxQane-no3GVCzGq4X-X7p9Y0_fva5qZO9bOrVg@mail.gmail.com \
    --to=tpm2@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.