Skip to content

security: persist and resolve revocation records - #224

Open
Harsh23Kashyap wants to merge 2 commits into
named-data:revokefrom
Harsh23Kashyap:ownly-revocation-followup
Open

Harsh23Kashyap wants to merge 2 commits into
named-data:revokefrom
Harsh23Kashyap:ownly-revocation-followup

Conversation

@Harsh23Kashyap

Copy link
Copy Markdown

Summary

  • reconstruct the exact certificate name encoded by a revocation-record name
  • make revocation insertion durable and idempotent while rejecting conflicting records
  • expose durable certificate-revocation lookup through TrustConfig
  • preserve signer-certificate validity checks when validating revocation records

Why

Consumers need to authorize a revocation target before the target certificate is necessarily cached. The exported name helper provides that exact identity without adding application-specific certificate conventions to ndnd. Durable lookup also removes the need for consumers to maintain a second in-memory revocation map.

InsertRevoke remains storage-oriented. Signature validation and application-specific authorization are caller preconditions.

Tests

  • go test ./...
  • go vet ./...
  • go test -race ./std/security/...
  • git diff --check

Comment on lines +122 to +127
if current, _ := tc.keychain.Store().Get(data.Name(), false); len(current) > 0 {
if bytes.Equal(current, wire.Join()) {
return nil
}
return fmt.Errorf("conflicting revocation record already stored: %s", data.Name())
}

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.

Could there be a use case for one certificate getting revoked multiple times?

@tianyuan129 ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I added this check to make InsertRevoke idempotent under replay. Receiving the same wire again can happen through sync or reconnection, so that case returns nil. A different packet with the same record name is rejected instead of silently overwriting the stored record.

Since the record name is deterministic for the exact certificate, this currently gives us first-write-wins behavior. A second revocation could still be useful to correct the reason or NotBefore, so this check would be too strict if updates are meant to be supported. In that case we should define whether the later record replaces the earlier one or gets a distinct/versioned name. I'll wait for Tianyuan's view before changing the behavior.

This branch has not been deployed

No deployments
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.

2 participants