<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — Using PolicyPCR]]></title>
		<link>https://www.wolfssl.com/forums/topic2289-using-policypcr.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic2289.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Using PolicyPCR.]]></description>
		<lastBuildDate>Wed, 05 Mar 2025 07:39:51 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Using PolicyPCR]]></title>
			<link>https://www.wolfssl.com/forums/post8246.html#p8246</link>
			<description><![CDATA[<div class="quotebox"><cite>dgarske wrote:</cite><blockquote><p>Hi Bijak Dawid,</p><p>Perhaps you can share your code, so I can attempt to reproduce with wolfTPM? Does the tpm2-tools sequence work correctly? If you&#039;d like to keep your code private you can email support at wolfssl dot com.</p><p>The most similar examples are probably:<br />* examples/nvram/policy_nv.c<br />* examples/boot/secret_seal.c</p><p>Thanks,<br />David Garske, wolfSSL</p></blockquote></div><p>Hi David,<br />Thank you for the quick answer! Ok, I would rather send the code per email.</p>]]></description>
			<author><![CDATA[null@example.com (bijak.dawid)]]></author>
			<pubDate>Wed, 05 Mar 2025 07:39:51 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8246.html#p8246</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using PolicyPCR]]></title>
			<link>https://www.wolfssl.com/forums/post8245.html#p8245</link>
			<description><![CDATA[<div class="quotebox"><cite>anthony wrote:</cite><blockquote><p>Hello Bijak Dawid, </p><p>My name is Anthony and I am a member of the wolfSSL team.&nbsp; Please have a look at <a href="https://github.com/wolfSSL/wolfTPM/blob/master/examples/native/native_test.c">https://github.com/wolfSSL/wolfTPM/blob … ive_test.c</a> for examples of how to use TPM2_EncryptDecrypt2().&nbsp; You can search for that function name in there.</p></blockquote></div><p>Hi Anthony, thanks for the quick reply. Regarding the native_test.c example - I was kinda hoping that I could use the higher level WolfTPM API instead of having to use the native API.</p><div class="quotebox"><cite>anthony wrote:</cite><blockquote><p>- what are your goals? <br />- where you are located? <br />- is this out of personal, academic or professional interest?</p></blockquote></div><p>I am looking into the WolfTPM Library in order to determine if it&#039;s fit for our project.</p><p>Thanks, Dawid</p>]]></description>
			<author><![CDATA[null@example.com (bijak.dawid)]]></author>
			<pubDate>Wed, 05 Mar 2025 07:38:03 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8245.html#p8245</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using PolicyPCR]]></title>
			<link>https://www.wolfssl.com/forums/post8244.html#p8244</link>
			<description><![CDATA[<p>Hi Bijak Dawid,</p><p>Perhaps you can share your code, so I can attempt to reproduce with wolfTPM? Does the tpm2-tools sequence work correctly? If you&#039;d like to keep your code private you can email support at wolfssl dot com.</p><p>The most similar examples are probably:<br />* examples/nvram/policy_nv.c<br />* examples/boot/secret_seal.c</p><p>Thanks,<br />David Garske, wolfSSL</p>]]></description>
			<author><![CDATA[null@example.com (dgarske)]]></author>
			<pubDate>Tue, 04 Mar 2025 21:56:43 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8244.html#p8244</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using PolicyPCR]]></title>
			<link>https://www.wolfssl.com/forums/post8241.html#p8241</link>
			<description><![CDATA[<p>Hello Bijak Dawid, </p><p>My name is Anthony and I am a member of the wolfSSL team.&nbsp; Please have a look at <a href="https://github.com/wolfSSL/wolfTPM/blob/master/examples/native/native_test.c">https://github.com/wolfSSL/wolfTPM/blob … ive_test.c</a> for examples of how to use TPM2_EncryptDecrypt2().&nbsp; You can search for that function name in there. </p><p>Let me know if this advice helps or if you need more details. </p><p>In the meantime, can you let me know a bit about yourself and your project? </p><p>- what are your goals? <br />- where you are located? <br />- is this out of personal, academic or professional interest? </p><p>Warm regards, Anthony <br />Warm regards, Anthony</p>]]></description>
			<author><![CDATA[null@example.com (anthony)]]></author>
			<pubDate>Tue, 04 Mar 2025 15:20:59 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8241.html#p8241</guid>
		</item>
		<item>
			<title><![CDATA[Using PolicyPCR]]></title>
			<link>https://www.wolfssl.com/forums/post8240.html#p8240</link>
			<description><![CDATA[<p>Hello,<br />I&#039;m trying to authenticate the use of a child key using a PolicyPCR.</p><p>In essence what im trying to achieve is the following<br /></p><div class="codebox"><pre><code>tpm2_startauthsession -S session.ctx
tpm2_policypcr -S session.ctx -l sha256:16 -L pcr_policy.digest

tpm2_createprimary -c primary.ctx
tpm2_create -C primary.ctx -G aes256 -u key.pub -r key.priv -L pcr_policy.digest
tpm2_load -C primary.ctx -u key.pub -r key.priv -c key.ctx

tpm2_startauthsession --policy-session -S session.ctx
tpm2_policypcr -S session.ctx -l sha256:16 
tpm2_encryptdecrypt -c key.ctx -o encrypted.dat  -p session:session.ctx plaintext.dat</code></pre></div><p>Using WolfTPM, I managed to compute the policyDigest using wolfTPM2_PCRGetDigest and wolfTPM2_PolicyPCRMake.<br />I could confirm that the digest is correct.<br />Next I created a new key using wolfTPM2_CreateKey, and set the digest in the .authPolicy field.<br />I also made sure that the TPMA_OBJECT_userWithAuth is not set.<br />Next after loading the key I create a new session using wolfTPM2_StartSession with TPM_SE_POLICY.<br />Then I called wolfTPM2_PolicyPCR, and passed the PCR index.<br />But everytime when calliing wolftTPM2_EncryptDecrypt im getting the error &quot;TPM2_EncryptDecrypt2 failed 0x12f: TPM_RC_AUTH_UNAVAILABLE: The authValue or authPolicy is not available for selected entity&quot;</p><p>I believe I am still missing some core TPM concepts. Could you please point out what am I missing. <br />Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (bijak.dawid)]]></author>
			<pubDate>Tue, 04 Mar 2025 14:32:52 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8240.html#p8240</guid>
		</item>
	</channel>
</rss>
