Skip to content

Add SignatureTime to Data - #114

Open
zjkmxy wants to merge 4 commits into
named-data:masterfrom
zjkmxy:dev4
Open

zjkmxy wants to merge 4 commits into
named-data:masterfrom
zjkmxy:dev4

Conversation

@zjkmxy

@zjkmxy zjkmxy commented Nov 3, 2026

Copy link
Copy Markdown
Member
  • Signers write SignatureTime to Data packets unless opt out.
  • Some signers who did not write SignatureTime in Interests will write SignatureTime unless opt out.

Fix: #101

Copilot AI balanced review requested due to automatic review settings November 3, 2026 14:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The signer test explicitly sets with_signature_time=True, leaving constructor defaults untested and allowing a regression to False to pass unnoticed.

1 open issue
What changed in this PR

Adds default SignatureTime generation to Data signing, addressing #101, and extends timestamp generation for signed Interests. Applications can opt out through signer constructors or keychain signing arguments.

Changes:

  • Enable optional SignatureTime generation across software and platform-backed signers.
  • Forward the opt-out flag through keychains and TPMs, with separate cached signer variants.
  • Add timestamp and opt-out tests, and adjust wire-format fixtures.
File Description
tests/​security/​signer_test.py Adds timestamp and opt-out coverage across signers.
tests/​misc/​nfd_mgmt_test.py Updates command fixtures for timestamped signatures.
tests/​integration/​keychain_test.py Tests opt-out propagation and separate cache entries.
tests/​encoding/​ndn_format_0_3_test.py Disables timestamps to preserve fixed wire fixtures.
src/​ndn/​security/​tpm/​tpm.py Adds the timestamp option to the TPM interface.
src/​ndn/​security/​tpm/​tpm_osx_keychain.py Supports configurable timestamps in macOS signing.
src/​ndn/​security/​tpm/​tpm_file.py Forwards the timestamp option to file-backed signers.
src/​ndn/​security/​tpm/​tpm_cng.py Supports configurable timestamps in Windows signing.
src/​ndn/​security/​signer/​sha256_rsa_signer.py Enables RSA signature timestamps by default.
src/​ndn/​security/​signer/​sha256_hmac_signer.py Enables HMAC signature timestamps by default.
src/​ndn/​security/​signer/​sha256_ecdsa_signer.py Enables ECDSA signature timestamps by default.
src/​ndn/​security/​signer/​sha256_digest_signer.py Separates timestamp generation from Interest nonce generation.
src/​ndn/​security/​signer/​ed25519_signer.py Enables Ed25519 signature timestamps by default.
src/​ndn/​security/​keychain/​keychain.py Documents the timestamp opt-out argument.
src/​ndn/​security/​keychain/​keychain_sqlite3.py Propagates the flag and distinguishes cached variants.
src/​ndn/​security/​keychain/​keychain_digest.py Forwards timestamp preferences to digest signers.

Review effort: Balanced

Comment thread tests/security/signer_test.py Resolved
Refactor signer factory creation to use a helper function for improved readability and maintainability.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the configurable signature timestamp changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support signature time in Data packet

2 participants