Fixup BIO demos for OpenSSL 1.1.x
authorRichard Levitte <levitte@openssl.org>
Thu, 8 Sep 2016 22:58:21 +0000 (00:58 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 20 Sep 2016 16:24:24 +0000 (18:24 +0200)
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 <rsalz@openssl.org>
demos/bio/client-arg.c
demos/bio/client-conf.c
demos/bio/saccept.c
demos/bio/sconnect.c
demos/bio/server-arg.c
demos/bio/server-cmod.c
demos/bio/server-conf.c

index 9e136e563d0b6eaf1ae6faf3454c9959701f764f..e8d5e46ab5365ddefc026820dcd5536252d49b13 100644 (file)
@@ -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);
index 66b5cac47ce5594de68e13370634ed6e17d0718a..e819030eecf74780380f4b49c1bc211207ece4e3 100644 (file)
@@ -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) {
index 106a089dafa7a0abee335dcfa287e68c76391c82..66c5c6175502d03f7427f54e3523102794d1007e 100644 (file)
@@ -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;
index 284bc3094426125ba0a4e9fe3edda003d534087e..664a1e038cf9e8e000c576472f083c709fa2ac3a 100644 (file)
@@ -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 */
index 4e9b7bdcb08d0fd3986bee04f5f17f3a901e0cf2..6056969fe9e83a4a56a125df5567d44bab54ad69 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <stdio.h>
+#include <string.h>
 #include <signal.h>
 #include <openssl/err.h>
 #include <openssl/ssl.h>
@@ -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();
index 77b456a459eacd11c2e06dedbac166bec13391aa..dfe233538e0ef4953f6411c495a9d0aa0919b397 100644 (file)
@@ -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;
index 32abefdf1d2c68149218e8434e4d3fcc5ec5402f..84d39f5f70952b974b55e59d781b378f66163199 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <stdio.h>
+#include <string.h>
 #include <signal.h>
 #include <openssl/err.h>
 #include <openssl/ssl.h>
@@ -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);