From 25904bf03fc103c088a91a1e06b32ce016407ba1 Mon Sep 17 00:00:00 2001 From: Lindsay Stewart Date: Mon, 5 Aug 2024 16:56:01 -0700 Subject: [PATCH] Actually fix build The interned builds were failing because the binaries couldn't access the libcrypto method to check the version. I tried conditional compilation, but different versions of libcrypto alias the version method to different methods and the check was getting too messy. So instead, I'm just going to call an s2n-tls method. s2nc and s2nd shouldn't do that, but they do that all over the place anyway. --- bin/s2nc.c | 4 ++-- bin/s2nd.c | 4 ++-- crypto/s2n_libcrypto.c | 2 +- crypto/s2n_libcrypto.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/s2nc.c b/bin/s2nc.c index 6adb8b8d410..ff15b66c887 100644 --- a/bin/s2nc.c +++ b/bin/s2nc.c @@ -33,7 +33,7 @@ #include "api/unstable/npn.h" #include "api/unstable/renegotiate.h" #include "common.h" -#include "crypto/s2n_openssl.h" +#include "crypto/s2n_libcrypto.h" #include "error/s2n_errno.h" #include "tls/s2n_connection.h" @@ -592,7 +592,7 @@ int main(int argc, char *const *argv) } GUARD_EXIT(s2n_init(), "Error running s2n_init()"); - printf("libcrypto: %s\n", SSLeay_version(SSLEAY_VERSION)); + printf("libcrypto: %s\n", s2n_libcrypto_get_version_name()); if ((r = getaddrinfo(host, port, &hints, &ai_list)) != 0) { fprintf(stderr, "error: %s\n", gai_strerror(r)); diff --git a/bin/s2nd.c b/bin/s2nd.c index b5541b7a233..08109807d79 100644 --- a/bin/s2nd.c +++ b/bin/s2nd.c @@ -34,7 +34,7 @@ #include "api/s2n.h" #include "api/unstable/npn.h" #include "common.h" -#include "crypto/s2n_openssl.h" +#include "crypto/s2n_libcrypto.h" #include "utils/s2n_safety.h" #define MAX_CERTIFICATES 50 @@ -566,7 +566,7 @@ int main(int argc, char *const *argv) } GUARD_EXIT(s2n_init(), "Error running s2n_init()"); - printf("libcrypto: %s\n", SSLeay_version(SSLEAY_VERSION)); + printf("libcrypto: %s\n", s2n_libcrypto_get_version_name()); printf("Listening on %s:%s\n", host, port); diff --git a/crypto/s2n_libcrypto.c b/crypto/s2n_libcrypto.c index 9e40500da6e..166e3bf86e3 100644 --- a/crypto/s2n_libcrypto.c +++ b/crypto/s2n_libcrypto.c @@ -55,7 +55,7 @@ * symbol OpenSSL_version binded to at link-time. This can be used as * verification at run-time that s2n linked against the expected libcrypto. */ -static const char *s2n_libcrypto_get_version_name(void) +const char *s2n_libcrypto_get_version_name(void) { return SSLeay_version(SSLEAY_VERSION); } diff --git a/crypto/s2n_libcrypto.h b/crypto/s2n_libcrypto.h index 9e7aff882b8..7ec83557eaf 100644 --- a/crypto/s2n_libcrypto.h +++ b/crypto/s2n_libcrypto.h @@ -18,5 +18,5 @@ #include "utils/s2n_result.h" S2N_RESULT s2n_libcrypto_validate_runtime(void); - +const char *s2n_libcrypto_get_version_name(void); bool s2n_libcrypto_supports_flag_no_check_time();