envoyproxy / envoy-openssl

Envoy OpenSSL extensions
Apache License 2.0
47 stars 45 forks source link

Initial prefixer tool #63

Closed tedjpoole closed 1 year ago

tedjpoole commented 1 year ago

Initial implementation of the header prefixer tool.

Signed-off-by: Ted Poole tpoole@redhat.com

pfl commented 1 year ago

Prefixer looks good! Next step is to get the linking part done and then an example file to use the prefixed functions, right?

tedjpoole commented 1 year ago

For each <function> declared in the source OpenSSL headers, the prefixer now:

The RAND_bytes() function has been modified to #include the prefixed "ossl/openssl/rand.h" header, and call onto the prefixed ossl_RAND_bytes() wrapper function., and the test_rand binary successfully links and runs.

pfl commented 1 year ago

LGTM! Compiling test_rand works fine when openssl is downloaded. But when I have openssl version 3.0.7 installed in the OS, the prefixer generates its files, but then compilation fails with

[ 21%] Building C object CMakeFiles/bssl-compat.dir/source/rand.c.o
In file included from /home/pflykt/projects/envoy-openssl/bssl-compat/source/rand.c:20:
In file included from /home/pflykt/projects/envoy-openssl/bssl-compat/build/include/ossl/openssl/rand.h:14:
/home/pflykt/projects/envoy-openssl/bssl-compat/build/include/ossl/openssl/macros.h:139:4: error: "The requested API level higher than the configured API compatibility level"
tedjpoole commented 1 year ago

Thanks for spotting that @pfl. I still have 1.1.1 on my host so I hadn't tried OpenSSL 3 yet! I'll take a look

tedjpoole commented 1 year ago

OpenSSL 3.0 will be addressed at a later date