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

Undeclared function 'RAND_priv_bytes' after switch to BoringSSL #138

Open
axelandersson opened this issue Oct 9, 2023 · 6 comments
Open

Comments

@axelandersson
Copy link
Contributor

axelandersson commented Oct 9, 2023

$ sw_vers 
ProductName:            macOS
ProductVersion:         14.0
BuildVersion:           23A344
$ swift -v
Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)

Checked out main:

commit 5dbf2fadd2ae30d4a90a1df0b8a02083727ba36a (HEAD -> main, origin/main, origin/HEAD)
Author: Felix Schlegel <fefefe152@gmail.com>
Date:   Thu Oct 5 10:16:41 2023 +0200

    Ship with BoringSSL (#135)

Pulled librdkafka:

$ git submodule update --remote
Cloning into '/Users/axel/swift-kafka-client/Sources/Crdkafka/librdkafka'...
Submodule path 'Sources/Crdkafka/librdkafka': checked out 'be353be5f6ceaa11a95e21472e981d871ab1aaee'

Ran swift test:

/Users/axel/swift-kafka-client/Sources/Crdkafka/librdkafka/src/rdkafka_admin.c:5481:21: error: call to undeclared function 'RAND_priv_bytes'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                if (RAND_priv_bytes(random_salt, sizeof(random_salt)) == 1) {
@FranzBusch
Copy link
Contributor

Thanks for reporting this. @axelandersson what OS are you trying to build this library on?

@axelandersson
Copy link
Contributor Author

Thanks for reporting this. @axelandersson what OS are you trying to build this library on?

This is on Sonoma 14.0 with Xcode 15 toolchain. Swift version:

Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)

@FranzBusch
Copy link
Contributor

Ah you updated the librdkafka version. If you don't do git submodule update --remote then it should build fine. @felixschlegel we gotta check why it fails on the latest librdkafka version though.

@hassila
Copy link

hassila commented Nov 22, 2023

@FranzBusch anything we can do to help out here?

@FranzBusch
Copy link
Contributor

@FranzBusch anything we can do to help out here?

Would appreciate a PR for it. I think the solution should be as easy as doing something like this #define RAND_priv_bytes(x,sz) RAND_bytes((x),(sz)) in a C file where we shim boringssl to openssl.

@hassila
Copy link

hassila commented Nov 22, 2023

#148

:-)

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

3 participants