Skip to content
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

"Can't find OpenSSL" #2014

Closed
richsalz opened this issue Dec 6, 2024 · 7 comments
Closed

"Can't find OpenSSL" #2014

richsalz opened this issue Dec 6, 2024 · 7 comments

Comments

@richsalz
Copy link

richsalz commented Dec 6, 2024

I am working on a fork of OpenSSL, QuicTLS (https://github.com/quictls/quictls). We are currently cleaning up a bunch of things to make the transition to cmake easier. One of the tests links against OQS and gets an error:

CMake Error at /usr/local/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR: (Required is at least version "1.1.1")
  (found /home/runner/work/quictls/quictls/libcrypto.so, )
Call Stack (most recent call first):
  /usr/local/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:601 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake-3.31/Modules/FindOpenSSL.cmake:691 (find_package_handle_standard_args)
  CMakeLists.txt:133 (find_package)

Do have you any clues as to what I did wrong to break things? Notably, include/openssl/opensslv.h is now subsumed into include/openssl/configuration.h{.in}. And tips or clues greatly appreciated!

@SWilson4
Copy link
Member

SWilson4 commented Dec 6, 2024

Hi @richsalz, thanks for the report. Which version of liboqs are you building against?

@richsalz
Copy link
Author

richsalz commented Dec 6, 2024

@SWilson4
Copy link
Member

SWilson4 commented Dec 6, 2024

I suspect this is due to the fact that we used to hardcode OPENSSL_ROOT_DIR to /usr on Linux. Why, I don't know, but this has been fixed since liboqs version 0.11.0. Based on the version of oqs-provider, I'd assume it's building against liboqs 0.8.0.

Did you recently upgrade to a newer version of CMake? (Possibly via a distro upgrade.) CMake changed the way it searches for OpenSSL in a way that exposed our bug (the hardcoding) somewhere between versions 3.25 and 3.28. That would explain why you are only seeing this bug now.

@SWilson4
Copy link
Member

SWilson4 commented Dec 6, 2024

Also, are you setting the OPENSSL_ROOT_DIR variable?

@richsalz
Copy link
Author

richsalz commented Dec 6, 2024

I haven't even written a cmakelist file yet :). I'm just cleaning up our branch (removing old things; see the dozen PRs) to make it easier to write the cmake files. Most PRs with the external test pass, like https://github.com/quictls/quictls/actions/runs/12185718584/job/33992602166?pr=139. Just this one branch which modified opensslv.h and other stuff, quictls/quictls#142 and the OQS eternal test fails, https://github.com/quictls/quictls/actions/runs/12201564498/job/34040276358?pr=142#step:9:60

So I figured I broke something. If you have any ideas or clues, let me know. Else you can just close this as "question answered" :)

@SWilson4
Copy link
Member

SWilson4 commented Dec 6, 2024

So I figured I broke something. If you have any ideas or clues, let me know.

If the test is passing on other branches in the same environment, then I wonder if something in the OpenSSL config changes caused CMake to not recognize the library as OpenSSL.

Else you can just close this as "question answered" :)

Will do as it seems unlikely to be an OQS-specific issue. But I do hope you find the bug!

@SWilson4 SWilson4 closed this as completed Dec 6, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in liboqs planning Dec 6, 2024
@richsalz
Copy link
Author

richsalz commented Dec 6, 2024

FYI, it turns out that cmake looks for strings in include/opensslv.hwhich I merged into configuration.h. So for now I'll hack something in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants