<br><tt><font size=2>"Kevin O'Connor" <kevin@koconnor.net>
wrote on 01/06/2016 12:47:29 PM:<br><br></font></tt><br><tt><font size=2>> <br>> On Wed, Jan 06, 2016 at 11:55:19AM -0500, Stefan Berger wrote:<br>> > "Kevin O'Connor" <kevin@koconnor.net> wrote on
01/05/2016 11:03:00 PM:<br>> > > On Tue, Jan 05, 2016 at 10:07:54PM -0500, Stefan Berger
wrote:<br>> > > > "Kevin O'Connor" <kevin@koconnor.net>
wrote on 01/05/2016 08:55:51 PM:<br>> > > > > Then it sounds like the only time we need to call
tpm_set_failure is<br>> > > > > on a failure of a TPM_ORD_Extend command.  It
might also make sense <br>> > to<br>> > > > > deactivate the TPM if we detect the hardware but
don't have the acpi<br>> > > > > tables present.<br>> > > > <br>> > > > I would also deactivate it if it returned an error
to<br>> > > > TPM_ORD_Startup, TPM_ORD_SelfTestFull.  Since
the menu is written in<br>> > > > such a way that the user only has the choices that
are valid for the<br>> > > > current state, also those commands have to work, unless
the TPM is<br>> > > > defective. Or is that too strict?<br>> > > <br>> > > Attempting to deactivate if TPM_ORD_Startup or TPM_ORD_SelfTestFull<br>> > > fail makes sense.<br>> > > <br>> > > I wonder if the code could attempt to assert physical presence
in<br>> > > tpm_startup() and only enable the tpm menu if that succeeds.<br>> > <br>> > There are two ways to assert physical presence, one is via software,
the <br>> > other via hardware.<br>> <br>> I should have said, "I wonder if the code could check if software<br>> physical presence has been enabled in tpm_startup() and only enable<br>> the tpm menu if that succeeds".  That is, could we issue
a</font></tt><br><br><tt><font size=2>I understood it that way.</font></tt><br><tt><font size=2><br>> TPM_ORD_PhysicalPresence(NOT_PRESENT) and if it succeeds then we<br>> enable the menu and make sure we always issue a LOCK before booting.</font></tt><br><br><tt><font size=2>What I am doing now in assert_physical_presence is
to check whether</font></tt><br><tt><font size=2>physical presence has already been asserted and return
0, check</font></tt><br><tt><font size=2>whether HW physical presence has been asserted and
return 0, if SW</font></tt><br><tt><font size=2>assertion has been disabled return -1, otherwise try
to do SW assertion.</font></tt><br><br><tt><font size=2>We need to issue TPM_ORD_PhysicalPresence(PRESENT)
to assert SW pp and</font></tt><br><tt><font size=2>TPM_ORD_PhysicalPresence(NOT_PRESENT + LOCK) in tpm_prepboot.</font></tt><br><br><tt><font size=2>tpm_prepboot actually needs to be further adapted
for the case of HW pp. Probably</font></tt><br><tt><font size=2>it is not necessary to send the CMD_ENABLE in any
case. I forgot about that</font></tt><br><tt><font size=2>in the patches I sent.</font></tt><br><br><tt><font size=2><br>> If the command fails then the code assumes it has no requirements
wrt<br>> physical presence.<br>> <br>> If that's too restrictive, could the startup code query if either<br>> CMD_ENABLE has already been set or if LifetimeLock has not been set?</font></tt><br><br><tt><font size=2>Have a look at the patch I sent. I think this correct
extends to assert_physical_presence</font></tt><br><tt><font size=2>function with making sure that SW pp is asserted or
HW pp is asserted through other means.</font></tt><br><tt><font size=2><br>> <br>> > For hardware assertion there's a PIN on the chip that indicates
the<br>> > state of a dip switch for example. Problem is, this assertion
cannot<br>> > easily be read as a flag.  We have to infer this via a command.
So<br>> > the trick seems to be to send TPM_PhysicalEnable/TPM_PhysicalDisable<br>> > with the value that's already there.<br>> <br>> Is there any BIOS requirements when hardware physical presence is
in<br>> use though?  If the hardware physical presence is set, then the
BIOS</font></tt><br><tt><font size=2>> can't limit the owner/activate/enable commands.
 So, why bother with<br>> the tpm menu - the user could just administer those settings from
the<br>> OS.<br></font></tt><br><tt><font size=2>In my opinion HW pp should also allow the menu to
be presented so </font></tt><br><tt><font size=2>that users do not need different tools in OS that
normally are not available</font></tt><br><tt><font size=2>due to SW pp. Though no command seems to be able to
overrid the HW physical</font></tt><br><tt><font size=2>presence.</font></tt><br><br><tt><font size=2>   Stefan</font></tt><br><br><tt><font size=2>> <br>> -Kevin<br>> <br></font></tt><BR>