<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 5, 2023 at 2:11 PM Felix Rubio <<a href="mailto:felix@kngnt.org">felix@kngnt.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">For what is explained on the the systemd-pcrphase.service(8) and <br>
comparing it to what I see in the log of the systemd services, there are <br>
three events in relation to this question:<br>
<br>
systemd-pcrphase-initrd.service<br>
[...]<br>
[systemd-ask-password-console.service]<br>
[...]<br>
systemd-pcrphase-sysinit<br>
systemd-pcrphase<br>
<br>
This means that, indeed, running cryptenroll after the new kernel has <br>
booted will never provide the correct PCR registry for 11. But then... <br>
what options do I have? Do I need to choose between having PCRs 7 and <br>
14, so that I make sure that SB is up and running and all the certs from <br>
shim have not changed, or to have only PCR 11 so that I know that the <br>
UKI has not changed although SB can potentially be even disabled <br>
(please, correct me if wrong)?<br></blockquote><div><br></div><div>I think the idea is to use `systemd-measure` to precompute PCR 11 for a specific phase, then use the precomputed PCR value instead of the "live" PCR value when sealing the data.<br></div></div><div class="gmail_quote"><br></div><div class="gmail_quote">systemd-cryptenroll does not accept raw PCR values directly (though I use a separate python script for that); instead it accepts --tpm2-public-key= as a public key that could be used to *sign* PCR values, and an external --tpm2-signature= path that'll contain the signed data.</div><div class="gmail_quote"><br></div><div class="gmail_quote">So I believe you're supposed to use systemd-measure to precompute and sign PCR 11, put the signed file in /boot, and tell systemd-cryptenroll to use that when unlocking. (Later you only need to re-sign the PCR measurements in /boot without needing to re-do cryptenroll.)</div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>