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

Improve OpenSSL KDF check #546

Merged
merged 2 commits into from Aug 9, 2021
Merged

Improve OpenSSL KDF check #546

merged 2 commits into from Aug 9, 2021

Conversation

nazar-pc
Copy link
Contributor

Without this change libsrtp2 usage with OpenSSL as subproject will fail with:

subprojects/libsrtp2/meson.build:134:10: ERROR: Dependencies must be external dependencies

I had to include 2 additional conditions:

  • make sure dependency is not internal, otherwise we know cc.has_function() will fail as error above suggests
  • check if user explicitly disabled crypto-library-kdf option (in which case there is no need to check anything and configuration incorrectly didn't take that into account)

P.S. OpenSSL as subproject/wrap will hopefully soon be a thing, see mesonbuild/wrapdb#113

@nazar-pc
Copy link
Contributor Author

nazar-pc commented Aug 3, 2021

Can someone review this, please? It is a pretty trivial, but also important change

@paulej
Copy link
Contributor

paulej commented Aug 4, 2021

Looks beautiful, but does it work? I have no idea. Who is the Meson expert?

openssl_dep.type_name() != 'internal' and
get_option('crypto-library-kdf').disabled() != true and
cc.has_function('kdf_srtp', dependencies: openssl_dep)
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, but

  • why do we have to exclude openssl as meson subproject here? I mean, is there a technical reason or is it just a shortcut because you know your openssl wrap doesn't provide this? (But it could in future, if a new version of openssl starts shipping this, or someone makes a modified subproject with it included)
  • use not get_option(..).disabled()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned in the very first comment cc.has_function() doesn't work with dependencies that are subprojects.
Applied second suggestion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, of course. Sorry, only started reading from the most recent email onwards :)

@nazar-pc
Copy link
Contributor Author

nazar-pc commented Aug 7, 2021

@tp-m can you confirm this looks good to you?

As to whether it works, it definitely does in versatica/mediasoup#622 where CI runs on Windows, Linux and macOS with various compilers and all builds/runs fine. And there is really nothing so significant here to break anything.

@tp-m
Copy link
Contributor

tp-m commented Aug 7, 2021

@tp-m can you confirm this looks good to you?

Yes, looks good to me.

Looking forward to be able to use this in GStreamer as well!

@pabuhler
Copy link
Member

pabuhler commented Aug 9, 2021

OpenSSL KDF check should probably be removed, I do not know of any actual use of OpenSSL KDF with libSRTP but that is a different issue.

@pabuhler pabuhler merged commit 3d15284 into cisco:master Aug 9, 2021
@nazar-pc nazar-pc deleted the patch-1 branch August 9, 2021 17:48
@nazar-pc nazar-pc restored the patch-1 branch August 9, 2021 17:48
@nazar-pc nazar-pc deleted the patch-1 branch August 9, 2021 23:33
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.

None yet

4 participants