cisco/libacvp

libacvp version

pablodelara opened this issue · 3 comments

Hello! Is it possible to get the libacvp version at compile time (e.g. macro storing the version in acvp.h header file)?
I see a couple of functions to retrieve the version at run time, but I am looking for something to use an #ifdef in the code, since there's been some API breakages in v2.0 (e.g. "acvp_create_test_session").
Thanks!

Hi,

We don't have any accessible preprocessor information for the version number. That is something I will look into adding for the next release if possible as I definitely see where it would be useful. One thing you could do is check to see if APis that are only available in 2.0 or greater are defined, e.g. the LMS capability APIs among others.

You could probably copy the version values from acvp_lcl.h to acvp.h without breaking anything and have access to them that way, but I haven't tested it.

Thanks!
Andrew

Thanks for your reply. Is it possible to check for an API at compile time? From what I can read, it is not possible. Thanks!

Addressed in #808. Now have access to all version number defines including ACVP_LIBRARY_VERSION_MAJOR, ACVP_LIBRARY_VERSION_MINOR, and ACVP_LIBRARY_VERSION_PATCH. Will be released in 2.1.0.

For versions prior to this, there isn't an easy quick way to do it sadly. Perhaps ou can use shell scripts to look for the version string in the source files and set cflags accordingly while configuring.

Closing, but feel free to reopen if any further questions pop up.

Thanks,
Andrew