<div dir="ltr"><div dir="ltr"><div>Dear folks</div><div><br></div><div>Looking over mailing list threads, it turns out that IssuerId is not the only missing information between KeyLocator name and successful retrieval of a certificate that conforms the validator's expected trust model. We are also missing the ForwardingHint.</div><div><br></div><div><a href="https://www.lists.cs.ucla.edu/pipermail/nfd-dev/2018-October/003398.html" target="_blank">https://www.lists.cs.ucla.edu/pipermail/nfd-dev/2018-October/003398.html</a></div><div><b>NDNCERT developers have suggested that </b>validators need to use ForwardingHint to retrieve the certificates issued by NDNCERT and published on NDNCERT server, if these certificates are not otherwise published by the producer itself. The <b>ForwardingHint necessary to reach the certificates should be placed as an extension field in the SignatureInfo</b>.</div><div><br></div><div>This is, in principle, as bad as putting IssuerId as part of the KeyLocator name.<br></div><div>Putting IssuerId into KeyLocator name restricts the Data packet to be verifiable only by validators using one particular trust model.</div><div>Putting ForwardingHint into SignatureInfo restricts certificate retrieval steps to communicate with one particular Certificate Authority, which is equivalent, from trust model point of view, to limiting to one particular IssuerId.<br></div><div><br></div><div>Yours, Junxiao<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 1, 2019 at 1:51 PM Junxiao Shi <<a href="mailto:shijunxiao@email.arizona.edu" target="_blank">shijunxiao@email.arizona.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 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><br></div></div></div>
</blockquote></div></div>