Project

General

Profile

Actions

Bug #3665

closed

Exclude doesn't support ranged operations using ImplicitSha256DigestComponent

Added by Alex Afanasyev almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Base
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
3.00 h

Description

The current code makes an assumption that an "empty" name component is a generic name component with empty content, which breaks the logic given ImplicitSha256DigestComponent type is smaller than GenericNameComponent.

The temporary solution would be to replace name::Component() with name::Component(Block(ImplicitSha256DigestComponent)).
The correct solution would be relax requirements (and update TLV spec) on what types name components can carry and then use name::Component(Block(0)).

Snippet to reproduce from Jeff Thompson:

BOOST_AUTO_TEST_CASE(ExcludeGenericImplicitDigest)
{
  uint8_t WIRE[32] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  Exclude exclude;
  exclude.excludeBefore(name::Component("C"));
  name::Component component = name::Component::fromImplicitSha256Digest(WIRE, sizeof(WIRE));
  BOOST_CHECK_EQUAL(exclude.isExcluded(component), true);
}

Related issues 2 (0 open2 closed)

Related to ndn-cxx - Feature #3681: Exclude range enumerationClosedJunxiao Shi

Actions
Related to NFD - Bug #3693: integ fails due to improper Exclude usageClosedEric Newberry08/01/2016

Actions
Actions

Also available in: Atom PDF