Skip to content

tlsh/tlsh.h has faulty definition of TLSH_STRING_BUFFER_LEN #114

@mapreri

Description

@mapreri

Look at this trivial bit:

mattia@warren /tmp/foo1 % cat test.cxx
#include<tlsh/tlsh.h>

int main(){
    return TLSH_STRING_BUFFER_LEN;
}
mattia@warren /tmp/foo1 % c++ -Wall -Werror test.cxx -ltlsh  
In file included from test.cxx:1:
test.cxx: In function ‘int main()’:
test.cxx:4:12: error: ‘TLSH_STRING_LEN_REQ’ was not declared in this scope; did you mean ‘TLSH_STRING_BUFFER_LEN’?
    4 |     return TLSH_STRING_BUFFER_LEN;
      |            ^~~~~~~~~~~~~~~~~~~~~~
1 mattia@warren /tmp/foo1 %

that's because tlsh.h defines TLSH_STRING_BUFFER_LEN using TLSH_STRING_LEN_REQ as base, but this is not defined outside of the current tlsh build, since defining that relies on the presence of any of BUCKETS_(48|64|128) that during the build is done from cmake.

This is since 4.0.0 (commit dc3f047), when you changed the definition of TLSH_STRING_LEN_REQ to not have an else branch anymore.

What's supposed to happen now? Should "includers" of the library define BUCKETS_* somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions