-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: PasswordTest with tpm2-tools #580
Comments
Please post questions to the mailing list. Their are folks far more knowledgeable than I on there. With that said, looking through the test code you mention and the tools test suite, there is no define with a password and test case. The TSS code tests for auth failed. FYI: It's easier if you list the nv attributes in a human readable form. Master branch supports this is well. No need for hex masks anymore.
I went through and looked at the call to
I am not 100% sure if this is:
|
Looks like a bug in the tool: |
Im actually going to reopen this as a ticket with "no tools test password authorization on nv-index access" Section 31.1 in:
It looks like your attributes are wrong based on this paragraph. |
I tried:
|
Thanks for your help! Sorry I don't know which mailing list you mean. I guess that I can't help to fix the bug, since my knowledge of TPMs is poor. I tried to marshal the commands myself and compared it with the tpm2-tools. My observations are, that the password specified with One example where this is used can be found in the wiki:
That works on my system. But I interpret this setting a password for the whole |
I think I found my problem. To use the index password, the authHandle (parameter # 0xc000c = policyread|policywrite|authread|authwrite
tpm2_nvdefine -x 0x1500015 -a 0x40000001 -s 32 -t 0xc000c -I "foo"
# succeeds as expected
tpm2_nvwrite -x 0x1500015 -a 0x1500015 -f ~/a.dat -P "foo"
# succeeds as expected
tpm2_nvwrite -x 0x1500015 -a 0x1500015 -f ~/a.dat -P "wrong"
# fails as expected error 0x98e = TPM_RC_AUTH_FAIL
tpm2_nvwrite -x 0x1500015 -a 0x40000001 -f ~/a.dat
# fails as expected error 0x149 = TPM_RC_NV_AUTHORIZATION
tpm2_nvwrite -x 0x1500015 -a 0x40000001 -f ~/a.dat -P "wrong"
# fails as expected error 0x9a2 = TPM_RC_BAD_AUTH
tpm2_nvread -x 0x1500015 -a 0x1500015 -s 32 -o 0 -P "foo"
# succeeds as expected
tpm2_nvread -x 0x1500015 -a 0x1500015 -s 32 -o 0 -P "wrong"
# fails as expected error 0x98e = TPM_RC_AUTH_FAIL
tpm2_nvread -x 0x1500015 -a 0x40000001 -s 32 -o 0
# fails as expected error 0x149 = TPM_RC_NV_AUTHORIZATION
tpm2_nvread -x 0x1500015 -a 0x40000001 -s 32 -o 0 -P "foo"
# fails as expected error 0x9a2 = TPM_RC_BAD_AUTH The index attribute ( Please keep in mind, that I'm using tpm-tools v2.0.0 and tpm-tss 1.0, so maybe there is a bug in the current version. I leave it up to you, to close the issue. |
For the mailing list, see the support section in the README.md file. This mailing list is:
https://lists.01.org/mailman/listinfo/tpm2
From: Roman Silberschneider [mailto:notifications@github.com]
Sent: Friday, October 27, 2017 12:34 AM
To: 01org/tpm2-tools <tpm2-tools@noreply.github.com>
Cc: Roberts, William C <william.c.roberts@intel.com>; State change <state_change@noreply.github.com>
Subject: Re: [01org/tpm2-tools] Question: PasswordTest with tpm2-tools (#580)
Thanks for your help! Sorry I don't know which mailing list you mean.
I guess that I can't help to fix the bug, since my knowledge of TPMs is poor. I tried to marshal the commands myself and compared it with the tpm2-tools. My observations are, that the password specified with tpm2_nvdefine -I parameter goes into the auth field described in "TPM2_NV_DefineSpace Command and Response" (TPM Library Specification Part 3, Section 31.3.2). Where the -P parameter of the tpm2_write command lives in the TPMS_AUTH_COMMAND struct (placed in the hmac field). The -P parameter can also be set at tpm2_nvdefine. Then it is also set in TPMS_AUTH_COMMAND.
One example where this is used can be found in the wiki:
https://github.com/01org/tpm2-tools/wiki/How-to-use-tpm2-tools
tpm2_takeownership -o ownerpass -e endorsepass -l lockpass
tpm2_nvdefine -x 0x1500001 -a 0x40000001 -s 32 -t 0x2000A -P ownerpass
tpm2_nvwrite -x 0x1500001 -a 0x40000001 -f nv.data -P ownerpass
That works on my system. But I interpret this setting a password for the whole TPM_RH_OWNER hierarchy. And that's not the purpose of an index password, if I understood this correctly.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub<#580 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AQ7bBwB8VzEdr7dTK-bVCj7wLKd2g0jVks5swYd2gaJpZM4QFfKg>.
|
@romansil @williamcroberts to reconcile the two problems here: |
btw @williamcroberts wasssup with all tools now displaying this message in latest master |
@idesai I think it's a bug in the errata infrastructure code. It shouldn't be an error if an errata isn't defined by a particular spec <level,rev,year,day>. Same for the Or alternatively, all the published specifications and errata versions should be added to the known_errata_info table. |
I thought I actually tried setting the auth handle to the pcr index and it didn't work... let me try again. |
Not only does this serve as a good example of how to use index and owner authorizations, this also tests that passwords enforcement works as expected. Fixes: tpm2-software#580 Signed-off-by: William Roberts <william.c.roberts@intel.com>
Not only does this serve as a good example of how to use index and owner authorizations, this also tests that passwords enforcement works as expected. Fixes: tpm2-software#580 Signed-off-by: William Roberts <william.c.roberts@intel.com>
Not only does this serve as a good example of how to use index and owner authorizations, this also tests that passwords enforcement works as expected. Fixes: tpm2-software#580 Signed-off-by: William Roberts <william.c.roberts@intel.com>
Hi,
I'm trying to understand the authorizations in the TPM protocol. Therefor I wanted to repoduce the behavior of the tpm2-tss test
PasswordTest
(src) with the tpm2-tools. For testing I use the IBM TPM 947 emulator, tpm-tools v2.0.0 and tpm-tss 1.0.I tried that with the following commands:
This brings me to the following error:
Decoding with
tpm2_rc_decode
:Writing without passwords and the attribute
-t 0x2000A
works. But that means no authorization at all.Have I misinterpreted the testcase?
Can anyone explain, what's the
-I ,--indexPasswd
argument good for?Kind regards,
Roman
The text was updated successfully, but these errors were encountered: