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

Compilation issues in external SRTP using third party library wolfssl support #734

Open
MahipalChalla opened this issue Dec 10, 2024 · 1 comment

Comments

@MahipalChalla
Copy link

Hello everyone,
I am working on a small task to generate session keys in external SRTP using the third-party library WolfSSL. As a starting step, I downloaded external SRTP from GitHub and the WolfSSL version wolfssl-5.7.4-gplv3-fips-ready. Initially, I enabled SRTP-related macros (WOLFSSL_SRTP) in the WolfSSL build, compiled it using CMake, and generated static and dynamic libraries

support KDF: Added below definations in CMakeLists.txt:

add_definitions(-DWC_SRTP_KDF)
add_definitions(-DHAVE_AES_ECB)
add_definitions(-DWOLFSSL_AES_COUNTER)

On the external SRTP build side, I enabled WolfSSL-related macros (ENABLE_WOLFSSL, WOLFSSL_KDF and WOLFSSL) and made the following changes in the CMakeLists.txt file:

Specify the path to the WolfSSL include directory and library

set(WOLFSSL_INCLUDE_DIR "/usr/local/include")
set(WOLFSSL_LIBRARY "/usr/local/lib/libwolfssl.a")

However, when attempting to compile in the Linux environment, I observed the following issues. I have checked the respective function headers and definitions available in /usr/local/include and /usr/local/lib.

/home/mahi/CTS/libsrtp-main/srtp/srtp.c:799:27: error: ‘WC_SRTP_MAX_SALT’ undeclared here (not in a function)
799 | #define MAX_SRTP_SALT_LEN WC_SRTP_MAX_SALT
| ^~~~~~~~~~~~~~~~
/home/mahi/CTS/libsrtp-main/srtp/srtp.c:808:25: note: in expansion of macro ‘MAX_SRTP_SALT_LEN’
808 | uint8_t master_salt[MAX_SRTP_SALT_LEN];
| ^~~~~~~~~~~~~~~~~
/home/mahi/CTS/libsrtp-main/srtp/srtp.c: In function ‘srtp_kdf_generate’:
/home/mahi/CTS/libsrtp-main/srtp/srtp.c:858:11: error: implicit declaration of function ‘wc_SRTP_KDF_label’ [-Werror=implicit-function-declaration]
858 | err = wc_SRTP_KDF_label(kdf->master_key, kdf->master_key_len,
| ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/srtp3.dir/build.make:79: CMakeFiles/srtp3.dir/srtp/srtp.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:114: CMakeFiles/srtp3.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

@pabuhler
Copy link
Member

Hi,

I have no problem to build if I download the latest wolfssl code. I use the cmake file in #735 to point to a local install of wolfssl and builds fine, including the KDF function.

Perhaps it is because you have the fips version?

If you look at https://github.com/cisco/libsrtp/actions/runs/12264388268/job/34218114347?pr=735#step:2:5 you can see how we build wolfssl for CI testing, and the resulting features at https://github.com/cisco/libsrtp/actions/runs/12264388268/job/34218114347?pr=735#step:2:255 maybe you can compare to your build or try to reproduce with these steps.

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

No branches or pull requests

2 participants