Actions
Bug #3665
closedExclude doesn't support ranged operations using ImplicitSha256DigestComponent
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);
}
Actions