<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Justin,<div class=""><br class=""></div><div class="">Thanks for debugging.  Using validator for sha256 (not really a valid signature) may not make too much sense, but we did some fixing in the checker that should get a bit farther (it was actually in the currently the last commit of the master branch).   You may want to re-check with the latest commit and see if it fixes your problem, if not, hope you can make and submit a patch.</div><div class=""><br class=""></div><div class="">-</div><div class="">Alex</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 7, 2021, at 9:06 PM, Justin Park = 세형 via Ndn-interest <<a href="mailto:ndn-interest@lists.cs.ucla.edu" class="">ndn-interest@lists.cs.ucla.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">Hi all,</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">Last Friday, I was working with NDN-CXX (0.7.0) for rsa-sha256, ecdsa-sha256, and sha256 validation.<span class="gmail-Apple-converted-space"> </span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">The first two (rsa-sha256, ecdsa-256) had no trouble, but I had some issues with sha256.</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">Of course, I followed the instruction below:</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; color: rgb(220, 161, 13);" class=""><a href="https://named-data.net/doc/ndn-cxx/current/tutorials/security-validator-config.html" class="">https://named-data.net/doc/ndn-cxx/current/tutorials/security-validator-config.html</a></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">  </span>checker</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">  </span>{</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">    </span>type customized</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">    </span>sig-type sha256</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">    </span>key-locator</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">    </span>{</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">      </span>type name</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">      </span>name /localhost/identity/digest-sha256</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">      </span>relation equal</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">    </span>}</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">  </span>}</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">However, when I tried something with sig-type sha256, I got “Internal implementation error.”</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">%9Bhq%A82%5B%AF%22%A7G%5E%B7%16%7C%1F8%93%AC?Nonce=f0547aea from forwarder<span class="gmail-Apple-converted-space">                                         </span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">1615167042.071117 DEBUG: [ndn.Face] <I /data/4?MustBeFresh&Nonce=8f696b08 <span class="gmail-Apple-converted-space">                                         </span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">1615167042.071596 DEBUG: [ndn.Face] >D /data/4<span class="gmail-Apple-converted-space">                                                                     </span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">1615167042.071643 DEBUG: [ndn.Face]<span class="gmail-Apple-converted-space">    </span>satisfying /data/4?MustBeFresh&Nonce=8f696b08 from app <span class="gmail-Apple-converted-space">                     </span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">1615167042.071655 DEBUG: [ndn.security.Validator] > Start validating data /data/4 <span class="gmail-Apple-converted-space">                                 </span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">1615167042.071660 TRACE: [ndn.security.validator_config.Rule] Trying to match /data/4 <span class="gmail-Apple-converted-space">                             </span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">1615167042.071675 TRACE: [ndn.security.validator_config.Rule] Trying to check /data/4 with keyLocator /localhost/id│</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">entity/digest-sha256<span class="gmail-Apple-converted-space">                                                                                               </span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">1615167042.073762 DEBUG: [ndn.security.ValidationState] > Internal implementation error (Validator/policy did not invoke success or failure callback)</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">To find the cause of errors, I followed the ndn-cxx source code from Validator::validate, to ValidationPolicyConfig::checkPolicy</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">to getKeyLocatorName, to Checker::check, to extractIdentityFromKeyName.</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">And I tentatively concluded that ndn-cxx doesn’t have the facility to validate pure “sha256” in the same manner as rsa-sha256 and ecdsa-sha256.</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">I also checked out ndn-cxx have verifyDigest in verification-helper.cpp, but verfiyDigest is only referenced in unit test codes.</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">My question is whether my speculation is rightand I also want to know the status and future plans regarding sha256 verification in Validator.</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">Thank you,</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">Justin</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">===================================</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">const Name&</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">SigningInfo::getDigestSha256Identity()</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">{</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">  </span>static Name digestSha256Identity("/localhost/identity/digest-sha256");</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">  </span>return digestSha256Identity;</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">}</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">===================================</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">Name</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">extractIdentityFromKeyName(const Name& keyName)</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">{</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">  </span>if (!isValidKeyName(keyName)) {</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">    </span>NDN_THROW(std::invalid_argument("Key name `" + keyName.toUri() + "` "</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">                                    </span>"does not respect the naming conventions"));</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">  </span>}</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue"; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class=""><span class="gmail-Apple-converted-space">  </span>return keyName.getPrefix(-Certificate::MIN_KEY_NAME_LENGTH); // trim everything after and including "KEY"</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue";" class="">}</div></div>
_______________________________________________<br class="">Ndn-interest mailing list<br class=""><a href="mailto:Ndn-interest@lists.cs.ucla.edu" class="">Ndn-interest@lists.cs.ucla.edu</a><br class="">http://www.lists.cs.ucla.edu/mailman/listinfo/ndn-interest<br class=""></div></blockquote></div><br class=""><div class="">
<div dir="auto" style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">______________<br class="">Alex Afanasyev<br class="">Assistant Professor, SCIS, Florida International University<br class="">11200 SW 8th Street, PG6 Room 140D, Miami, FL 33199<br class="">phone: +1.305.348.4960 (office); <a href="mailto:aa@cs.fiu.edu" class="">email: aa@cs.fiu.edu</a><br class="">web: <a href="https://users.cs.fiu.edu/~afanasyev/" class="">https://users.cs.fiu.edu/~afanasyev/</a><br class=""><br class=""></div>

</div>
<br class=""></div></body></html>