named-data / python-ndn

An NDN client library with AsyncIO support in Python 3
https://python-ndn.readthedocs.io/en/latest
Apache License 2.0
24 stars 17 forks source link

LVS Key Suggestor does not return trust anchor #60

Open tianyuan129 opened 1 year ago

tianyuan129 commented 1 year ago

The highlighted piece of code avoids returning all self-signed certificates.

# This is to avoid self-signed certificate
if (not cert.signature_info or not cert.signature_info.key_locator
        or not cert.signature_info.key_locator.name):
    continue

If trust anchor is in the keychain, the key suggestor never returns it even if it's a valid signer.

zjkmxy commented 1 year ago

This is because the design and implementation of the suggest function did not consider the use by controller. To add more context: this code is added to fix the problem that the function may return a self-signed certificate that is not the trust anchor but satisfies the trust schema's check, as we only check packet name vs cert name, but not further move to cert name vs cert's signer.