From: Richard Levitte Date: Thu, 8 Sep 2016 22:58:21 +0000 (+0200) Subject: Fixup BIO demos for OpenSSL 1.1.x X-Git-Tag: OpenSSL_1_1_0a~35 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f506d8247709f82ec1b123819ea975afe45a55c5;p=oweals%2Fopenssl.git Fixup BIO demos for OpenSSL 1.1.x Note: server-cmod doesn't seem to do things right... from loading cmod.cnf, it tries to load libssl_conf.so. Reviewed-by: Rich Salz (cherry picked from commit 16c6deed2c42d4cf4a7676a32b718d6a867f482a) --- diff --git a/demos/bio/client-arg.c b/demos/bio/client-arg.c index 9e136e563d..e8d5e46ab5 100644 --- a/demos/bio/client-arg.c +++ b/demos/bio/client-arg.c @@ -23,10 +23,6 @@ int main(int argc, char **argv) const char *connect_str = "localhost:4433"; int nargs = argc - 1; - ERR_load_crypto_strings(); - ERR_load_SSL_strings(); - SSL_library_init(); - ctx = SSL_CTX_new(TLS_client_method()); cctx = SSL_CONF_CTX_new(); SSL_CONF_CTX_set_flags(cctx, SSL_CONF_FLAG_CLIENT); diff --git a/demos/bio/client-conf.c b/demos/bio/client-conf.c index 66b5cac47c..e819030eec 100644 --- a/demos/bio/client-conf.c +++ b/demos/bio/client-conf.c @@ -26,10 +26,6 @@ int main(int argc, char **argv) const char *connect_str = "localhost:4433"; long errline = -1; - ERR_load_crypto_strings(); - ERR_load_SSL_strings(); - SSL_library_init(); - conf = NCONF_new(NULL); if (NCONF_load(conf, "connect.cnf", &errline) <= 0) { diff --git a/demos/bio/saccept.c b/demos/bio/saccept.c index 106a089daf..66c5c61755 100644 --- a/demos/bio/saccept.c +++ b/demos/bio/saccept.c @@ -26,7 +26,7 @@ static int done = 0; -void interrupt() +void interrupt(int sig) { done = 1; } @@ -58,11 +58,6 @@ int main(int argc, char *argv[]) else port = argv[1]; - SSL_load_error_strings(); - - /* Add ciphers and message digests */ - OpenSSL_add_ssl_algorithms(); - ctx = SSL_CTX_new(TLS_server_method()); if (!SSL_CTX_use_certificate_chain_file(ctx, CERT_FILE)) goto err; diff --git a/demos/bio/sconnect.c b/demos/bio/sconnect.c index 284bc30944..664a1e038c 100644 --- a/demos/bio/sconnect.c +++ b/demos/bio/sconnect.c @@ -55,11 +55,6 @@ char *argv[]; sock_init(); #endif - /* Lets get nice error messages */ - SSL_load_error_strings(); - - /* Setup all the global SSL stuff */ - OpenSSL_add_ssl_algorithms(); ssl_ctx = SSL_CTX_new(TLS_client_method()); /* Enable trust chain verification */ diff --git a/demos/bio/server-arg.c b/demos/bio/server-arg.c index 4e9b7bdcb0..6056969fe9 100644 --- a/demos/bio/server-arg.c +++ b/demos/bio/server-arg.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -30,11 +31,6 @@ int main(int argc, char *argv[]) char **args = argv + 1; int nargs = argc - 1; - SSL_load_error_strings(); - - /* Add ciphers and message digests */ - OpenSSL_add_ssl_algorithms(); - ctx = SSL_CTX_new(TLS_server_method()); cctx = SSL_CONF_CTX_new(); diff --git a/demos/bio/server-cmod.c b/demos/bio/server-cmod.c index 77b456a459..dfe233538e 100644 --- a/demos/bio/server-cmod.c +++ b/demos/bio/server-cmod.c @@ -27,11 +27,6 @@ int main(int argc, char *argv[]) SSL_CTX *ctx; int ret = 1, i; - SSL_load_error_strings(); - - /* Add ciphers and message digests */ - OpenSSL_add_ssl_algorithms(); - if (CONF_modules_load_file("cmod.cnf", "testapp", 0) <= 0) { fprintf(stderr, "Error processing config file\n"); goto err; diff --git a/demos/bio/server-conf.c b/demos/bio/server-conf.c index 32abefdf1d..84d39f5f70 100644 --- a/demos/bio/server-conf.c +++ b/demos/bio/server-conf.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -33,10 +34,6 @@ int main(int argc, char *argv[]) char buf[512]; int ret = 1, i; - SSL_load_error_strings(); - - /* Add ciphers and message digests */ - OpenSSL_add_ssl_algorithms(); conf = NCONF_new(NULL);