Skip to content

Botan 3 migration (+ Delete FindBotan.cmake) #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

Phatcat
Copy link
Contributor

@Phatcat Phatcat commented Apr 21, 2025

Use the CMake builtin botan configuration for finding botan

Seems like the findx.cmake approach is getting deprecated. Botan got a configuration file for cmake back in 2023 (randombit/botan#3722), let's utilize that.

Works perfectly with a vcpkg setup; docker is getting the include dir wrong. This has been reported to botan and they're looking into it.

srp6 needs to have botan in target_link_libraries or it cannot utilize botan:

#20 2.797 [  8%] Building CXX object src/libs/srp6/CMakeFiles/srp6.dir/src/Generator.cpp.o
#20 2.808 In file included from /usr/src/ember/src/libs/srp6/src/Generator.cpp:9:
#20 2.808 /usr/src/ember/src/libs/srp6/include/srp6/Generator.h:11:10: fatal error: botan/bigint.h: No such file or directory
#20 2.808    11 | #include <botan/bigint.h>
#20 2.808       |          ^~~~~~~~~~~~~~~~
#20 2.809 compilation terminated.
#20 2.810 make[2]: *** [src/libs/srp6/CMakeFiles/srp6.dir/build.make:79: src/libs/srp6/CMakeFiles/srp6.dir/src/Generator.cpp.o] Error 1
#20 2.810 make[1]: *** [CMakeFiles/Makefile2:1881: src/libs/srp6/CMakeFiles/srp6.dir/all] Error 2
#20 2.810 make[1]: *** Waiting for unfinished jobs....
#20 4.905 [  9%] Linking CXX static library conpool.a
#20 4.972 [  9%] Built target conpool
#20 6.539 [  9%] Linking CXX static library ../../../lib/gtest.a
#20 6.612 [  9%] Built target gtest
#20 6.614 make: *** [Makefile:146: all] Error 2

libs/shared/utility/FileMD5.cpp calls for botan without having it linked in the shared libs cmakefile.

#18 18.95 [ 30%] Building CXX object src/libs/shared/CMakeFiles/shared.dir/shared/utility/FileMD5.cpp.o
#18 19.09 /usr/src/ember/src/libs/shared/shared/utility/FileMD5.cpp:10:10: fatal error: botan/bigint.h: No such file or directory
#18 19.09    10 | #include <botan/bigint.h>
#18 19.09       |          ^~~~~~~~~~~~~~~~
#18 19.09 compilation terminated.
#18 19.09 make[2]: *** [src/libs/shared/CMakeFiles/shared.dir/build.make:219: src/libs/shared/CMakeFiles/shared.dir/shared/utility/FileMD5.cpp.o] Error 1
#18 19.09 make[2]: *** Waiting for unfinished jobs....
#18 20.53 make[1]: *** [CMakeFiles/Makefile2:1817: src/libs/shared/CMakeFiles/shared.dir/all] Error 2
#18 20.53 make: *** [Makefile:146: all] Error 2

CURRENT STATUS: RFC

Fully building 0 warnings all tests passing: Addressing #75

@Phatcat Phatcat force-pushed the botan branch 18 times, most recently from 564ab59 to 45784c0 Compare April 21, 2025 18:50
@Phatcat Phatcat changed the title Findx.cmake deprecation WIP: Botan 3 migration Apr 21, 2025
@Phatcat Phatcat force-pushed the botan branch 11 times, most recently from 2b4568b to 55e05b4 Compare April 22, 2025 04:29
@Phatcat Phatcat force-pushed the botan branch 4 times, most recently from df2af4d to bc6ccfe Compare April 25, 2025 18:24
@Phatcat Phatcat changed the title [RFC]: Botan 3 migration [RFC]: Botan 3 migration (+ Delete FindBotan.cmake) Apr 26, 2025
@Phatcat Phatcat force-pushed the botan branch 3 times, most recently from 4ce84ef to 2a9c717 Compare April 28, 2025 01:37
@Phatcat Phatcat changed the title [RFC]: Botan 3 migration (+ Delete FindBotan.cmake) [WIP]: Botan 3 migration (+ Delete FindBotan.cmake) Apr 30, 2025
@Phatcat Phatcat marked this pull request as draft April 30, 2025 03:47
@Phatcat Phatcat force-pushed the botan branch 6 times, most recently from 8f349a3 to 8af7255 Compare April 30, 2025 22:20
@Phatcat Phatcat changed the title [WIP]: Botan 3 migration (+ Delete FindBotan.cmake) Botan 3 migration (+ Delete FindBotan.cmake) Apr 30, 2025
@Phatcat Phatcat marked this pull request as ready for review April 30, 2025 22:22
@Phatcat Phatcat force-pushed the botan branch 5 times, most recently from c2c9dda to 1cffed9 Compare May 2, 2025 03:04
Phatcat added 3 commits May 29, 2025 07:19
Removal of FindBotan and using supplied config

target_link_libraries:
srp6 need botan and doesn't have it linked
libs/shared need to be linked to botan as well
Complete Botan-3 migration targeting:

Migrate from marked as deprecated functions
 -1363 padding needs to be done manually now
 -No serialization directly on the hasher
 -no declaration of functions with a serialization.
Patch the botan config file for libbotan-3-dev. It is expecting the header files in a wrong location
Same goes for the library files, it is not considering multi architecture.
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.

1 participant