Skip to content

Commit

Permalink
Actually fix build
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lrstewart committed Aug 6, 2024
1 parent f7ec1f1 commit 25904bf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bin/s2nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions bin/s2nd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion crypto/s2n_libcrypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion crypto/s2n_libcrypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

0 comments on commit 25904bf

Please sign in to comment.