Skip to content

Commit

Permalink
Don't call OPENSSL_init_* on 1.1.1 and later
Browse files Browse the repository at this point in the history
This fixes a weird error wherein gambit will not output anything to its
current-output-port if OPENSSL_init_ssl is called and stdout is a terminal
(though stdout itself still works for e.g. printf, and it works fine if
stdout was redirected to a file. Weird.)
  • Loading branch information
fare committed May 24, 2024
1 parent 8ecfbfa commit 5a3c0d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/std/crypto/libcrypto.ss
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ END-C
)

(c-initialize #<<END-C
#if (OPENSSL_VERSION_MAJOR < 1) || ((OPENSSL_VERSION_MAJOR == 1) && (OPENSSL_VERSION_MINOR == 0))
OPENSSL_init_crypto(0, NULL);
#endif
END-C
)

Expand Down
4 changes: 3 additions & 1 deletion src/std/net/ssl/libssl.ss
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ END-C
)

(c-initialize #<<END-C
OPENSSL_init_ssl(0, NULL);
#if (OPENSSL_VERSION_MAJOR < 1) || ((OPENSSL_VERSION_MAJOR == 1) && (OPENSSL_VERSION_MINOR == 0))
OPENSSL_init_crypto(0, NULL);
#endif
ffi_ssl_gerbil_data_index = SSL_get_ex_new_index(0, "gerbil data", NULL, NULL, NULL);
END-C
)
Expand Down

0 comments on commit 5a3c0d4

Please sign in to comment.