<div dir="ltr"><div>Hi Lan</div><div><br></div><div>Whether "both certificates are valid for the same key" depends on the trust schema of the validator. I'm not dealing with multiple trust anchors here.</div><div><br></div><div>A real world example: when Let's Encrypt started, its root certificate "ISRG Root X1" was not recognized by browsers, so they had their "Authority X3" key cross-signed by IdenTrust.</div><div><div><div><img src="cid:ii_k1ca0d5d1" alt="image.png" width="318" height="196" style="margin-right: 0px;"><br></div></div></div><div><br></div><div>The equivalent in NDN would be "Authority X3" key has two certificates:</div><div><font face="monospace">/lets-encrypt/KEY/X3/ISRG/35=%01</font></div><div><font face="monospace">/lets-encrypt/KEY/X3/IdenTrust/35=%01</font></div><div><br></div><div><div>On a packet signed by "Authority X3" key, the KeyLocator name would be 

<font face="monospace">/lets-encrypt/KEY/X3</font>.</div><div></div></div><div>Suppose we have a validator that ONLY knows IdenTrust as a trust anchor, but does not recognize "ISRG Root X1" as a trust anchor.</div><div>When it sends an Interest for <font face="monospace">/lets-encrypt/KEY/X3</font> , it could receive the certificate <font face="monospace">/lets-encrypt/KEY/X3/ISRG/35=%01</font> that have a KeyLocator <font face="monospace">/isrg-root/KEY.X1</font> .</div><div>The validator will then retrieve the "ISRG Root X1" certificate, and see it's a self-signed certificate but not a trust anchor (remember this validator ONLY recognizes IdenTrust).</div><div>Eventually, validator rejects the original packet.</div><div><br></div><div>What SHOULD happen is that, the validator needs to retrieve the 

<font face="monospace">/lets-encrypt/KEY/X3/IdenTrust/35=%01</font> certificate instead of (or in addition to) <font face="monospace">/lets-encrypt/KEY/X3/ISRG/35=%01</font> certificate.</div><div>This would allow it to continue validation toward a known trust anchor.</div><div><br></div><div>The question here is: how could the validator know to retrieve the <font face="monospace">/lets-encrypt/KEY/X3/IdenTrust/35=%01</font> certificate?</div><div><br></div><div>Yours, Junxiao</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 3, 2019 at 8:19 AM Lan Wang (lanwang) <<a href="mailto:lanwang@memphis.edu">lanwang@memphis.edu</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">



<div style="overflow-wrap: break-word;">
If both certificates are valid (for the same key), why would the trust model expect only one of the certificates, not the other one?  The trust model should be updated to allow either one.  My recent ICN paper talks about supporting multiple trust anchors and
 schemas for this case.   This is something the application can do, although maybe library support will help.  For more information, you can read: 
<div><br>
</div>
<div><span style="background-color:rgb(255,255,255)"><span style="font-family:"Lucida Grande",LucidaGrande,Lucida,Helvetica,Arial,sans-serif;font-variant-ligatures:normal">A. Gawande, J. Clark,
 D. Coomes, </span><b style="font-family:"Lucida Grande",LucidaGrande,Lucida,Helvetica,Arial,sans-serif;font-variant-ligatures:normal">L. Wang</b><span style="font-family:"Lucida Grande",LucidaGrande,Lucida,Helvetica,Arial,sans-serif;font-variant-ligatures:normal">,
 "</span><a href="http://web0.cs.memphis.edu/~lanwang/paper/ICN19-npchat.pdf" style="font-family:"Lucida Grande",LucidaGrande,Lucida,Helvetica,Arial,sans-serif;font-variant-ligatures:normal" target="_blank">Decentralized and Secure
 Multimedia Sharing Application over Named Data Networking</a><span style="font-family:"Lucida Grande",LucidaGrande,Lucida,Helvetica,Arial,sans-serif;font-variant-ligatures:normal">," in </span><i style="font-family:"Lucida Grande",LucidaGrande,Lucida,Helvetica,Arial,sans-serif;font-variant-ligatures:normal">Proceedings
 of ACM Conference on Information Centric Networking</i><span style="font-family:"Lucida Grande",LucidaGrande,Lucida,Helvetica,Arial,sans-serif;font-variant-ligatures:normal">, Sept. 2019</span></span><br>
<div><br>
<span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline">Lan</span>
</div>
<div><br>
<blockquote type="cite">
<div>On Oct 2, 2019, at 8:35 AM, Junxiao Shi <<a href="mailto:shijunxiao@email.arizona.edu" target="_blank">shijunxiao@email.arizona.edu</a>> wrote:</div>
<br>
<div>
<div dir="ltr">
<div>Hi Lan</div>
<div><br>
</div>
<div>Finding the latest certificate name ("latest" as in "latest version") is a solved problem: Realtime Data Retrieval (RDR) protocol allows a validator to identify which version is the latest.</div>
<div>Suppose there are two certificate versions from the same issuer:</div>
<div>
<ul>
<li><font face="monospace">/ndn/web/KEY/%29%964%F6%11%12%1C%9A/NA/%FD%01</font></li><li><font face="monospace">/ndn/web/KEY/%29%964%F6%11%12%1C%9A/NA/%FD%02</font></li></ul>
</div>
<div>Using RDR protocol, the validator could ask:  <font face="monospace">
/ndn/web/KEY/%29%964%F6%11%12%1C%9A/NA/32=metadata</font> CanBePrefix=1 MustBeFresh=1, and get a reply that
<font face="monospace">%FD%02</font> is the latest version.</div>
<div><br>
</div>
<div>However, <b>knowing the latest version does not help when there are multiple issuers</b>.</div>
<div>In the example given in <a href="https://www.lists.cs.ucla.edu/pipermail/ndn-interest/2019-October/002600.html" target="_blank">
my last post</a>, there are certificates issued by two separate issuers:</div>
<div>
<ul>
<li><font face="monospace">/ndn/web/KEY/%29%964%F6%11%12%1C%9A/NA/%FD%00%00%01i%FE%FD~%BF<br>
</font></li><li><font face="monospace">/ndn/web/KEY/%29%964%F6%11%12%1C%9A/X/%FD%00%00%01m%88%1E%0A%07</font><br>
</li></ul>
</div>
<div>RDR cannot currently operate on this level, but can easily be extended to do so. Then, the latest version among these two certificates would be <font face="monospace">/ndn/web/KEY/%29%964%F6%11%12%1C%9A/X/%FD%00%00%01m%88%1E%0A%07</font>
 as its version component has a greater number. However, if the validator is expecting ndn-testbed-root-v2 trust anchor, the validation will fail.</div>
<div><br>
</div>
<div><br>
</div>
<div><b>Enumerating the namespace</b> using <a href="https://redmine.named-data.net/issues/4666" target="_blank">namespace catalog protocol</a> might help. The validator can:</div>
<div>
<ol>
<li>Enumerate <font face="monospace">/ndn/web/KEY/%29%964%F6%11%12%1C%9A</font> namespace, and find there are two issuerIds "NA" and "X".</li><li>Fetch the latest certificate under each issuerId.</li><li>Determine which certificate(s) to follow up according to trust schema.</li></ol>
</div>
<div>However, isn't it better to make issuerId part of the trust schema itself, so that the validator could skip the namespace enumeration step.</div>
<div><br>
</div>
<div><br>
</div>
<div>A related problem: both RDR and namespace catalog protocol need some way to verify the response Data packets come from the namespace owner. If we don't yet have the certificate of the namespace owner, how can we trust the responses?</div>
<div><br>
</div>
<div>Yours, Junxiao</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Oct 2, 2019 at 8:52 AM Lan Wang (lanwang) <<a href="mailto:lanwang@memphis.edu" target="_blank">lanwang@memphis.edu</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">
<div>It seems to me that a separate system is needed to find the latest certificate name (e.g., through NDNS).  That’s an orthogonal issue to the KeyLocator format which seems to be fine the way it is.<br>
<div><br>
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline">Lan</span>
</div>
<div><br>
<blockquote type="cite">
<div>On Oct 1, 2019, at 12:51 PM, Junxiao Shi <<a href="mailto:shijunxiao@email.arizona.edu" target="_blank">shijunxiao@email.arizona.edu</a>> wrote:</div>
<br>
<div>
<div dir="ltr">
<div>Dear folks</div>
<div><br>
</div>
<div>I wonder what's the relation between KeyLocator name and Certificate name?<br>
</div>
<div><br>
</div>
<div><a href="https://named-data.net/doc/NDN-packet-spec/0.3/signature.html#keylocator" target="_blank">Packet format spec</a> says this on KeyLocator name:</div>
<div style="margin-left:40px">The specific definition of the usage of Name and KeyDigest options in KeyLocator field is outside the scope of this specification. Generally,
<b>Name names the Data packet with the corresponding certificate</b>. However, it is up to the specific trust model to define whether this name is a full name of the Data packet or a prefix that can match multiple Data packets. For example, the
<a href="https://named-data.net/publications/techreports/trpublishkey-rev2/" target="_blank">
hierarchical trust model</a> uses the latter approach, requiring clients to fetch the latest version of the Data packet pointed by the KeyLocator (the latest version of the public key certificate) in order to ensure that the public key was not yet revoked.</div>
<br>
<div><a href="https://named-data.net/doc/ndn-cxx/0.6.6/specs/certificate-format.html#name" target="_blank">Certificate format spec</a> defines certificate name to be:</div>
<div style="margin-left:40px"><font face="monospace">/<SubjectName>/KEY/[KeyId]/[IssuerId]/[Version]</font></div>
<div style="margin-left:40px"><br>
</div>
<div style="margin-left:40px"></div>
<div style="margin-left:40px"><b>KeyId</b> is an opaque name component to
<b>identify an instance of the public key </b>for the certificate namespace. The value of Key ID is
<b>controlled by the namespace owner </b>and can be an 8-byte random number, SHA-256 digest of the public key, timestamp, or a simple numerical identifier.<br>
</div>
<div style="margin-left:40px"><br>
</div>
<div style="margin-left:40px"><b>Issuer Id</b> is an opaque name component to
<b>identify issuer of the certificate</b>. The value is <b>controlled by the certificate issuer</b> and, similar to KeyId, can be an 8-byte random number, SHA-256 digest of the issuer’s public key, or a simple numerical identifier.
</div>
<div><br>
</div>
<div></div>
<div>In today's testbed, most applications are setting the KeyLocator name to be /<SubjectName>/KEY/[KeyId].</div>
<div>For example, ivoosh server's Data packet <span style="font-family:monospace">
/ndn/web/video/research_questions/hls/playlist.m3u8/%FD01/%00%00 </span>uses KeyLocator name
<span style="font-family:monospace">/ndn/web/KEY/%29%964%F6%11%12%1C%9A</span> .<br>
</div>
After expressing an Interest for that name, I receive a certificate named  <span style="font-family:monospace">
/ndn/web/KEY/%29%964%F6%11%12%1C%9A/NA/%FD%00%00%01i%FE%FD~%BF</span> .<br>
<div>
<div><br>
</div>
<div>Everything seems to be working fine. However, <b>what if there are more than one certificates associated with the key?</b></div>
<div>Suppose the namespace owner requests me to issue a new certificate to his existing public key, I could execute:</div>
<div><span style="font-family:monospace">ndnpeek /ndn/web/KEY/%29%964%F6%11%12%</span><span style="font-family:monospace">1C%9A/NA/%FD%00%00%01i%FE%FD~%</span><span style="font-family:monospace">BF | base64 | ndnsec cert-gen
 -i X - | base64 -d > X.data</span><br>
</div>
<div>and then let him publish the new certificate: <font face="monospace">
/ndn/web/KEY/%29%964%F6%11%12%1C%9A/X/%FD%00%00%01m%88%1E%0A%07</font></div>
<div><br>
</div>
<div>Now, <b>anyone who asks for a certificate using the KeyLocator name</b>
<font face="monospace">/ndn/web/KEY/%29%964%F6%11%12%1C%9A</font> <b>
could receive either of the two certificates</b>.</div>
<div>The validator, depending on the trust model, could be expecting one of these certificates.</div>
<div>If it happens to receive the other certificate, validation would fail because the signer does not match policy.</div>
<div><br>
</div>
<div>So, what's the solution space?</div>
<div><br>
</div>
<div>Trying to <b>ensure there is only one issuer per key</b> defeats the purpose of having IssuerId name component in the first place.</div>
<div>The reason to have IssuerId is that, a namespace owner can obtain certificates from multiple issuers on the same public key, so that the same content can be made available under multiple trust models.</div>
<div><br>
</div>
<div><b>Adding IssuerId to KeyLocator name</b> seems to fix the problem of validator receiving the wrong certificate.</div>
<div>However, this would require the namespace owner to generate separate Data packets for each trust model.</div>
<div>In this case, she may as well use separate keys.</div>
<div>
<div><br>
</div>
<div><b>Providing all certificates in a bundle</b> could solve the problem.</div>
<div>The producer would include certificates from multiple distinct trust models in the
<a href="https://redmine.named-data.net/issues/2766#note-30" target="_blank">
certificate bundle</a>, and then the validator should attempt to validate the original packet using each certificate matching the KeyLocator name, and accept the original packet if any certificate chain leads to a trust anchor configured in the validator.</div>
<div>A drawback of this solution is inflation of certificate bundle size.</div>
<div><br>
</div>
<div></div>
</div>
<div><b>Appending an IssuerId component in the validator </b>appears to be the best solution. The validator needs to know, through static configuration, what IssuerId to append to each KeyLocator name.<br>
</div>
<div>For example, a validator configured to work with ndncert-legacy's certificate chain could be configured to always append 'NA' as IssuerId. Given the KeyLocator name shown above, the validator would fetch certificate using <span style="font-family:monospace">/ndn/web/KEY/%29%964%F6%11%12%</span><span style="font-family:monospace">1C%9A/NA</span> and
 it would receive the expected certificate.</div>
<div><br>
</div>
<div>Please REPLY-ALL with your thoughts on this topic.</div>
<div><br>
</div>
<div>Yours, Junxiao</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>

</blockquote></div></div>